Skip to content

otel-agent: support Deployment kind, routing directly to existing otel-collector#863

Merged
michaellzc merged 2 commits into
mainfrom
claude/slack-integration-p81g4
May 8, 2026
Merged

otel-agent: support Deployment kind, routing directly to existing otel-collector#863
michaellzc merged 2 commits into
mainfrom
claude/slack-integration-p81g4

Conversation

@michaellzc
Copy link
Copy Markdown
Member

@michaellzc michaellzc commented May 7, 2026

ref https://github.com/sourcegraph/sourcegraph/pull/12299
ref https://sourcegraph.slack.com/archives/C05MW2TMYAV/p1778179723106999

Summary

Added openTelemetry.agent.kind value ("DaemonSet" | "Deployment", default "DaemonSet") for environments where DaemonSets are restricted (e.g. some customer limitation)

When kind: "Deployment", the otel-agent DaemonSet is not created and application pods send traces directly to the existing otel-collector Deployment via http://otel-collector:4317 (the pre-existing ClusterIP service with gRPC OTLP on port 4317)

Test plan

kind cluster with below override. tested and it worked

storageClass:
  create: false
  name: standard

sourcegraph: 
  localDevMode: true
  image:
    repository: us-docker.pkg.dev/sourcegraph-images/external
    defaultTag: docker-images-notest-michaellz_370952_2026-05-08_7.2-48f70aff43d4 #370941_2026-05-07_7.2-2c8911ef83a9
    useGlobalTagAsDefault: true

openTelemetry:
  enabled: true
  agent:
    kind: Deployment

jaeger:
  enabled: true

there's no more otel-agent ds:

CleanShot 2026-05-07 at 18 51 42

can view the trace in jager:

CleanShot 2026-05-07 at 18 49 50 CleanShot 2026-05-07 at 18 49 31

Generated by Claude Code

Copy link
Copy Markdown
Member Author

michaellzc commented May 8, 2026

@michaellzc michaellzc changed the base branch from main to graphite-base/863 May 8, 2026 01:40
@michaellzc michaellzc force-pushed the claude/slack-integration-p81g4 branch from 3a46505 to fbd3a51 Compare May 8, 2026 01:40
@michaellzc michaellzc changed the base branch from graphite-base/863 to 05-07-fix_otel_agent_is_not_picking_up_traces May 8, 2026 01:40
@michaellzc michaellzc requested review from a team and marcleblanc2 May 8, 2026 01:51
Base automatically changed from 05-07-fix_otel_agent_is_not_picking_up_traces to main May 8, 2026 01:52
claude added 2 commits May 7, 2026 18:52
Adds `openTelemetry.agent.kind` value (default: `DaemonSet`) to allow
customers who cannot run DaemonSets in their clusters to deploy the
otel-agent as a Deployment instead.

When `kind: Deployment`:
- A Deployment is created instead of the DaemonSet
- A ClusterIP Service (`otel-agent`) is created to front the agent pods
- Application pods send traces to `http://otel-agent:4317` (the Service)
  rather than to the node's host IP via hostPort

`openTelemetry.agent.replicas` can be set to control the replica count
when running as a Deployment (defaults to 1).

https://claude.ai/code/session_01K2AnXLduzruntPtUsC7xiA
When openTelemetry.agent.kind=Deployment, skip the otel-agent DaemonSet
and point OTEL_EXPORTER_OTLP_ENDPOINT directly at the existing
otel-collector Deployment (http://otel-collector:4317), which already has
the OTLP gRPC receiver enabled.

Removes the unnecessary otel-agent Deployment + ClusterIP Service that
were added in the previous commit.

https://claude.ai/code/session_01K2AnXLduzruntPtUsC7xiA
@michaellzc michaellzc force-pushed the claude/slack-integration-p81g4 branch from fbd3a51 to 09a44c2 Compare May 8, 2026 01:52
@michaellzc michaellzc enabled auto-merge (squash) May 8, 2026 01:53
@michaellzc michaellzc merged commit 227d138 into main May 8, 2026
6 checks passed
@michaellzc michaellzc deleted the claude/slack-integration-p81g4 branch May 8, 2026 05:23
@marcleblanc2
Copy link
Copy Markdown
Contributor

Excellent work, thank you so much!

@marcleblanc2
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants