kibana/packages/kbn-elastic-agent-utils
jennypavlova 44073ae34a
[8.16] [ObsUX] [APM] [OTel] Runtime metrics show dashboards with different ingest path (#211822) (#213545)
# Backport

This will backport the following commits from `main` to `8.16`:
- [[ObsUX] [APM] [OTel] Runtime metrics show dashboards with different
ingest path (#211822)](https://github.com/elastic/kibana/pull/211822)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
2025-03-12 13:29:22 +01:00
..
src [8.16] [ObsUX] [APM] [OTel] Runtime metrics show dashboards with different ingest path (#211822) (#213545) 2025-03-12 13:29:22 +01:00
index.ts [8.16] [ObsUX] [APM] [OTel] Runtime metrics show dashboards with different ingest path (#211822) (#213545) 2025-03-12 13:29:22 +01:00
jest.config.js Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kibana.jsonc [ObsInfra][APM] Extract agent utils and custom icons (#170968) 2023-11-20 16:39:42 +01:00
package.json Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
README.md [ObsInfra][APM] Extract agent utils and custom icons (#170968) 2023-11-20 16:39:42 +01:00
tsconfig.json [ObsInfra][APM] Extract agent utils and custom icons (#170968) 2023-11-20 16:39:42 +01:00

@kbn/elastic-agent-utils

A utility package providing functions for working with Elastic Agents. This package focuses on agent names used in various contexts, such as OpenTelemetry, Java, Rum (Real User Monitoring), Mobile, JRuby, and Serverless environments.

Functions

  • isOpenTelemetryAgentName

    export function isOpenTelemetryAgentName(agentName: string): agentName is OpenTelemetryAgentName;
    

    Check if the provided agent name is part of the OpenTelemetry agents.

  • isJavaAgentName

    export function isJavaAgentName(agentName?: string): agentName is JavaAgentName;
    

    Check if the provided agent name is part of the Java agents.

  • isRumAgentName

    export function isRumAgentName(agentName?: string): agentName is RumAgentName;
    

    Check if the provided agent name is part of the Rum (Real User Monitoring) agents.

  • isMobileAgentName

    export function isMobileAgentName(agentName?: string): boolean;
    

    Check if the provided agent name is either an iOS or Android agent.

  • isRumOrMobileAgentName

    export function isRumOrMobileAgentName(agentName?: string): boolean;
    

    Check if the provided agent name is either a Rum agent or a Mobile agent.

  • isIosAgentName

    export function isIosAgentName(agentName?: string): boolean;
    

    Check if the provided agent name is "ios/swift."

  • isAndroidAgentName

    export function isAndroidAgentName(agentName?: string): boolean;
    

    Check if the provided agent name is "android/java."

  • isJRubyAgentName

    export function isJRubyAgentName(agentName?: string, runtimeName?: string): boolean;
    

    Check if the provided agent name is "ruby" and the runtime name is "jruby."

  • isServerlessAgentName

    export function isServerlessAgentName(serverlessType?: string): serverlessType is ServerlessType;
    

    Check if the provided serverless type is part of the supported Serverless environments.

  • isAWSLambdaAgentName

    export function isAWSLambdaAgentName(serverlessType?: string): serverlessType is ServerlessType;
    

    Check if the provided serverless type is "aws.lambda."

  • isAzureFunctionsAgentName

    export function isAzureFunctionsAgentName(
      serverlessType?: string
    ): serverlessType is ServerlessType;
    

    Check if the provided serverless type is "azure.functions."

Additional Exports

The @kbn/elastic-agent-utils package also exports several constants and types for commonly used agent names. These exports can be utilized for broader categorizations and validations within your Elastic Agent projects.

Agent Names Constants

  • ELASTIC_AGENT_NAMES

    An array of Elastic Agent names, including various programming languages and platforms.

  • OPEN_TELEMETRY_AGENT_NAMES

    An array of OpenTelemetry agent names, covering different languages and platforms supporting OpenTelemetry.

  • JAVA_AGENT_NAMES

    An array of Java agent names, including both generic Java and OpenTelemetry Java agents.

  • RUM_AGENT_NAMES

    An array of Real User Monitoring (RUM) agent names, encompassing both base JavaScript and specific RUM agents.

  • SERVERLESS_TYPE

    An array of supported Serverless types, including AWS Lambda and Azure Functions.

Agent Name Types

  • ElasticAgentName

  • OpenTelemetryAgentName

  • JavaAgentName

  • RumAgentName

  • ServerlessType

    These types represent the available agent name categories, providing TypeScript type safety for agent name usage.

Combined Agent Names

  • AgentName

    A union type combining all agent name categories.

  • AGENT_NAMES

    An array containing all available agent names from the combined categories.