forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#195242) closes elastic#192606 ## Summary v2 based on the work done in this PR elastic#192608 and the suggestion from Dario elastic#194424 This PR replaces the _source usage in APM queries with fields to support Otel data. The idea is to get rid of existing UI errors we have and make sure that otel data is shown correctly in the UI. One way to check it is using the [e2e PoC](https://github.com/elastic/otel-apm-e2e-poc/blob/main/README.md). --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Jenny <[email protected]> (cherry picked from commit 7235ed0)
- Loading branch information
1 parent
7245dc5
commit 09f2c7c
Showing
67 changed files
with
1,612 additions
and
385 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 |
---|---|---|
|
@@ -9,5 +9,7 @@ | |
|
||
export interface Container { | ||
id?: string | null; | ||
image?: string | null; | ||
image?: { | ||
name?: string; | ||
}; | ||
} |
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 |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
|
||
// only for RUM agent: shared by error and transaction | ||
export interface Page { | ||
url: string; | ||
url?: string; | ||
} |
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 |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
|
||
export interface Url { | ||
domain?: string; | ||
full: string; | ||
full?: string; | ||
original?: string; | ||
} |
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 |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
*/ | ||
|
||
export interface User { | ||
id: string; | ||
id?: string; | ||
} |
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
40 changes: 40 additions & 0 deletions
40
x-pack/packages/observability/observability_utils/object/unflatten_object.test.ts
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,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { unflattenObject } from './unflatten_object'; | ||
|
||
describe('unflattenObject', () => { | ||
it('unflattens deeply nested objects', () => { | ||
expect(unflattenObject({ 'first.second.third': 'third' })).toEqual({ | ||
first: { | ||
second: { | ||
third: 'third', | ||
}, | ||
}, | ||
}); | ||
}); | ||
|
||
it('does not unflatten arrays', () => { | ||
expect( | ||
unflattenObject({ | ||
simpleArray: ['0', '1', '2'], | ||
complexArray: [{ one: 'one', two: 'two', three: 'three' }], | ||
'nested.array': [0, 1, 2], | ||
'complex.nested': [{ one: 'one', two: 'two', 'first.second': 'foo', 'first.third': 'bar' }], | ||
}) | ||
).toEqual({ | ||
simpleArray: ['0', '1', '2'], | ||
complexArray: [{ one: 'one', two: 'two', three: 'three' }], | ||
nested: { | ||
array: [0, 1, 2], | ||
}, | ||
complex: { | ||
nested: [{ one: 'one', two: 'two', first: { second: 'foo', third: 'bar' } }], | ||
}, | ||
}); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
x-pack/packages/observability/observability_utils/object/unflatten_object.ts
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,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { set } from '@kbn/safer-lodash-set'; | ||
|
||
export function unflattenObject(source: Record<string, any>, target: Record<string, any> = {}) { | ||
// eslint-disable-next-line guard-for-in | ||
for (const key in source) { | ||
const val = source[key as keyof typeof source]; | ||
|
||
if (Array.isArray(val)) { | ||
const unflattenedArray = val.map((item) => { | ||
if (item && typeof item === 'object' && !Array.isArray(item)) { | ||
return unflattenObject(item); | ||
} | ||
return item; | ||
}); | ||
set(target, key, unflattenedArray); | ||
} else { | ||
set(target, key, val); | ||
} | ||
} | ||
return target; | ||
} |
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 |
---|---|---|
|
@@ -21,5 +21,6 @@ | |
"@kbn/es-types", | ||
"@kbn/apm-utils", | ||
"@kbn/es-query", | ||
"@kbn/safer-lodash-set", | ||
] | ||
} |
Oops, something went wrong.