Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix otel service detection #180574

Merged
merged 8 commits into from
Apr 22, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/kbn-elastic-agent-utils/src/agent_guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ import type {
} from './agent_names';

export function isOpenTelemetryAgentName(agentName: string): agentName is OpenTelemetryAgentName {
return OPEN_TELEMETRY_AGENT_NAMES.includes(agentName as OpenTelemetryAgentName);
return (
SylvainJuge marked this conversation as resolved.
Show resolved Hide resolved
agentName?.startsWith('opentelemetry/') ||
OPEN_TELEMETRY_AGENT_NAMES.includes(agentName as OpenTelemetryAgentName)
);
}

export function isJavaAgentName(agentName?: string): agentName is JavaAgentName {
return JAVA_AGENT_NAMES.includes(agentName! as JavaAgentName);
return (
agentName?.startsWith('opentelemetry/java') ||
JAVA_AGENT_NAMES.includes(agentName! as JavaAgentName)
);
}

export function isRumAgentName(agentName?: string): agentName is RumAgentName {
Expand Down