forked from opensearch-project/OpenSearch-Dashboards
-
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.
[APM] Add new agent name 'rum-js' (#33212) (#33458)
* [APM] Closes #32643 by adding new agent name 'rum-js' for telemetry and docs links * [APM] replaced enum with union type + set, and consolidated util functions operating on agent names * [APM] code cleanup and fixing comments * [APM] move AgentName type def to es_schemas, and the agent name functions to common, leverage object hash to reference names * [APM] code cleanup and improve type assertion between AgentName type and object mapping
- Loading branch information
Showing
9 changed files
with
76 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
/* | ||
* Agent names can be any string. This list only defines the official agents | ||
* that we might want to target specifically eg. linking to their documentation | ||
* & telemetry reporting. Support additional agent types by appending | ||
* definitions in mappings.json (for telemetry), the AgentName type, and the | ||
* agentNames object. | ||
*/ | ||
import { AgentName } from '../typings/es_schemas/ui/fields/Agent'; | ||
|
||
const agentNames: { [agentName in AgentName]: agentName } = { | ||
python: 'python', | ||
java: 'java', | ||
nodejs: 'nodejs', | ||
'js-base': 'js-base', | ||
'rum-js': 'rum-js', | ||
ruby: 'ruby', | ||
go: 'go' | ||
}; | ||
|
||
export function isAgentName(agentName: string): boolean { | ||
return Object.values(agentNames).includes(agentName as AgentName); | ||
} | ||
|
||
export function isRumAgentName(agentName: string): boolean { | ||
return ([agentNames['js-base'], agentNames['rum-js']] as string[]).includes( | ||
agentName | ||
); | ||
} |
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
*/ | ||
|
||
export { | ||
AgentName, | ||
storeApmTelemetry, | ||
createApmTelementry, | ||
APM_TELEMETRY_DOC_ID | ||
|
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