-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model: move Event, Session, and URL up to APMEvent (#5872)
Also, remove Transaction.Page and Error.Page. Page details have been duplicated in ECS fields since 7.9.0, and we don't reference the page fields in the UI.
- Loading branch information
Showing
62 changed files
with
326 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -745,7 +745,9 @@ | |
"trace": { | ||
"id": "abcdef0123456789abcdef9876543210" | ||
}, | ||
"url.original": "http://localhost:8000", | ||
"url": { | ||
"original": "http://localhost:8000" | ||
}, | ||
"user": { | ||
"domain": "ldap://abc", | ||
"email": "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ func TestAPMEventFields(t *testing.T) { | |
uid := "12321" | ||
mail := "[email protected]" | ||
agentName := "elastic-node" | ||
outcome := "success" | ||
|
||
for _, test := range []struct { | ||
input APMEvent | ||
|
@@ -61,6 +62,9 @@ func TestAPMEventFields(t *testing.T) { | |
Client: Client{Domain: "client.domain"}, | ||
Process: Process{Pid: pid}, | ||
User: User{ID: uid, Email: mail}, | ||
Event: Event{Outcome: outcome}, | ||
Session: Session{ID: "session_id"}, | ||
URL: URL{Original: "url"}, | ||
Labels: common.MapStr{"a": "b", "c": 123}, | ||
Transaction: &Transaction{}, | ||
Timestamp: time.Date(2019, 1, 3, 15, 17, 4, 908.596*1e6, time.FixedZone("+0100", 3600)), | ||
|
@@ -75,16 +79,18 @@ func TestAPMEventFields(t *testing.T) { | |
"name": "myservice", | ||
"node": common.MapStr{"name": serviceNodeName}, | ||
}, | ||
"user": common.MapStr{"id": "12321", "email": "[email protected]"}, | ||
"client": common.MapStr{"domain": "client.domain"}, | ||
"source": common.MapStr{"domain": "client.domain"}, | ||
"user": common.MapStr{"id": "12321", "email": "[email protected]"}, | ||
"client": common.MapStr{"domain": "client.domain"}, | ||
"source": common.MapStr{"domain": "client.domain"}, | ||
"event": common.MapStr{"outcome": outcome}, | ||
"session": common.MapStr{"id": "session_id"}, | ||
"url": common.MapStr{"original": "url"}, | ||
"labels": common.MapStr{ | ||
"a": "b", | ||
"c": 123, | ||
}, | ||
|
||
// fields related to APMEvent.Transaction | ||
"event": common.MapStr{"outcome": ""}, | ||
"processor": common.MapStr{ | ||
"name": "transaction", | ||
"event": "transaction", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package model | ||
|
||
import ( | ||
"github.com/elastic/beats/v7/libbeat/common" | ||
) | ||
|
||
// Event holds information about an event, in ECS terms. | ||
// | ||
// https://www.elastic.co/guide/en/ecs/current/ecs-event.html | ||
type Event struct { | ||
// Outcome holds the event outcome: "success", "failure", or "unknown". | ||
Outcome string | ||
} | ||
|
||
func (e *Event) fields() common.MapStr { | ||
var fields mapStr | ||
fields.maybeSetString("outcome", e.Outcome) | ||
return common.MapStr(fields) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.