Skip to content

Populate ClientLibraryName Field - #286

Merged
adamjeanlaurent merged 1 commit into
masterfrom
ajeanlaurent/clientlibraryname
Oct 13, 2026
Merged

adamjeanlaurent merged 1 commit into
masterfrom
ajeanlaurent/clientlibraryname

Conversation

@adamjeanlaurent

Copy link
Copy Markdown
Contributor

The M3 reporter now sends the client library name oss_go_tally in each metric batch. The M3
collector uses this field to identify which client library sent the metrics.

Changes

  • m3/thrift/v2/v2.thrift: add 3: optional string clientLibraryName to MetricBatch.
  • m3/thrift/v2/ttypes.go: regenerate with Thrift 0.9.3, the same compiler version as the
    existing generated code.
  • m3/thrift/thrift.diff: update the MetricBatch struct hunk so that make gen-thrift still
    reproduces the generated files.
  • m3/reporter.go: add the exported constant ClientLibraryName = "oss_go_tally". The reporter
    sets it on every batch. It is also set on the batch that NewReporter uses to calculate packet
    overhead, so the packet size limit includes the field.

The field is optional. Code that builds its own MetricBatch does not send the field unless it
sets it.

Compatibility

Readers that do not know field 3 skip it. A collector in strict mode rejects unknown fields, so
the collector must support field 3 before services pick up this version.

Testing

  • make test passes.
  • TestReporter checks that each decoded batch contains oss_go_tally, for binary and compact
    protocol.
  • The new test TestMetricBatchClientLibraryNameRoundTrip writes and reads a batch with the
    field set and unset, for both protocols.
  • Raw Thrift 0.9.3 output plus thrift.diff reproduces the committed generated files exactly.

@CLAassistant

CLAassistant commented Oct 13, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@adamjeanlaurent
adamjeanlaurent merged commit 139f4ef into master Oct 13, 2026
7 checks passed
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