Skip to content

faet: add rabbitmq cluster_name - #50907

Open
abhishuraina wants to merge 3 commits into
open-telemetry:mainfrom
abhishuraina:main
Open

faet: add rabbitmq cluster_name#50907
abhishuraina wants to merge 3 commits into
open-telemetry:mainfrom
abhishuraina:main

Conversation

@abhishuraina

@abhishuraina abhishuraina commented Sep 11, 2026

Copy link
Copy Markdown

Description

Add a rabbitmq.cluster.name resource attribute, scraped from GET /api/cluster-name (same pattern as the existing GetQueues/GetNodes/GetExchanges) — no new connection or credentials needed.

Resource attribute, disabled by default — same convention as rabbitmq.vhost.name.
Applies to all three resource types (collectQueue/collectNode/collectExchange) — unlike vhost, cluster name isn't vhost-scoped, so it belongs on node metrics too.

Link to tracking issue

Fixes #50168

Testing

CGO_ENABLED=0 go test ./... (pass)
CGO_ENABLED=0 go vet ./... (pass)
git diff --check (pass)
go test -race ./... could not run on the local Windows image because its installed 32-bit C compiler cannot build 64-bit race binaries; upstream CI should run the race job on supported runners.

Documentation

Regenerated documentation.md via mdatagen

Authorship

  • I, a human, wrote this pull request description myself.

@abhishuraina
abhishuraina requested a review from a team as a code owner September 11, 2026 04:31
@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.
  • First-time contributors should keep at most one PR marked as ready for review until their first PR is merged; once two are open for review, any further PR is automatically converted to draft.
  • If your change isn't one of our priority components, reviews may take more time.
  • Raise technical or Collector-specific questions in #otel-collector-dev or a Collector SIG meeting.

@singhvibhanshu

Copy link
Copy Markdown
Member

/workflow-approve

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-11 06:29 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Regenerate internal/metadata/config.schema.yaml to include rabbitmq.cluster.name.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an optional, disabled-by-default rabbitmq.cluster.name attribute from RabbitMQ’s /api/cluster-name endpoint to queue, node, and exchange metrics.

Changes:

  • Adds client, model, mock, scraper, and test support.
  • Updates metadata, generated artifacts, documentation, fixtures, and changelog.
  • Component configuration schema still requires regeneration.
File summaries
File Summary
receiver/rabbitmqreceiver/testdata/apiresponses/get_cluster_name_response.json Adds cluster-name API fixture.
receiver/rabbitmqreceiver/scraper.go Fetches and attaches the cluster name.
receiver/rabbitmqreceiver/scraper_test.go Tests cluster-name behavior.
receiver/rabbitmqreceiver/metadata.yaml Defines the disabled-by-default attribute; schema regeneration is pending.
receiver/rabbitmqreceiver/internal/models/models.go Adds the response model.
receiver/rabbitmqreceiver/internal/mocks/client.go Adds mock client support.
receiver/rabbitmqreceiver/internal/metadata/testdata/config.yaml Updates metadata test configuration.
receiver/rabbitmqreceiver/internal/metadata/generated_resource.go Updates generated resource handling.
receiver/rabbitmqreceiver/internal/metadata/generated_resource_test.go Tests generated resource handling.
receiver/rabbitmqreceiver/internal/metadata/generated_metrics.go Updates generated metric filtering.
receiver/rabbitmqreceiver/internal/metadata/generated_metrics_test.go Tests generated metric metadata.
receiver/rabbitmqreceiver/internal/metadata/generated_config.go Updates generated configuration.
receiver/rabbitmqreceiver/internal/metadata/generated_config_test.go Tests generated configuration.
receiver/rabbitmqreceiver/documentation.md Documents the new attribute.
receiver/rabbitmqreceiver/client.go Adds cluster-name API retrieval.
receiver/rabbitmqreceiver/client_test.go Tests API responses and errors.
.chloggen/feat_rabbitmq-cluster-name.yaml Adds the changelog entry.
Review details

Files not reviewed (7)

  • receiver/rabbitmqreceiver/internal/metadata/generated_config.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_config_test.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_metrics.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_metrics_test.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_resource.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_resource_test.go: Generated file
  • receiver/rabbitmqreceiver/internal/mocks/client.go: Generated file
  • Files reviewed: 10/17 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread receiver/rabbitmqreceiver/metadata.yaml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified, and the changes include corresponding tests and generated metadata updates.

Review details

Files not reviewed (7)

  • receiver/rabbitmqreceiver/internal/metadata/generated_config.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_config_test.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_metrics.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_metrics_test.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_resource.go: Generated file
  • receiver/rabbitmqreceiver/internal/metadata/generated_resource_test.go: Generated file
  • receiver/rabbitmqreceiver/internal/mocks/client.go: Generated file
  • Files reviewed: 11/18 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@abhishuraina

Copy link
Copy Markdown
Author

Hi @paulojmdias I've addressed the comments from the AI feedback, can you please re review this PR.

@paulojmdias

Copy link
Copy Markdown
Member

@VenuEmmadi PTAL as code owner

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/rabbitmq] Add rabbitmq.cluster.name resource attribute ( RabbitMQ cluster Name )

4 participants