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

Add support for per cpu metrics #5756

Merged
merged 1 commit into from
Oct 15, 2021
Merged

Conversation

dloucasfx
Copy link
Contributor

@dloucasfx dloucasfx commented Oct 14, 2021

Signed-off-by: Dani Louca dlouca@splunk.com

Description:
Fixes #5243
With this change, the signalfx exporter is able to emit per core cpu metrics.
The dimension cpu exists for non-aggregated/per_core metrics

Link to tracking Issue:
Fixes #5243

Documentation:

This config example will emit per core and aggregated cpu.interrupt metric

  signalfx:
    access_token: "********"
    api_url: "https://api.us0.signalfx.com"
    ingest_url: "https://ingest.us0.signalfx.com"
    include_metrics:
      - metric_name: "cpu.interrupt"

This config example will emit per core only cpu.interrupt metric

 signalfx:
    access_token: "********"
    api_url: "https://api.us0.signalfx.com"
    ingest_url: "https://ingest.us0.signalfx.com"
    include_metrics:
      - metric_name: "cpu.interrupt"
        dimensions:
          cpu: ["*"]

@dloucasfx dloucasfx requested review from a team and anuraaga October 14, 2021 20:31
@dloucasfx
Copy link
Contributor Author

cc: @mstumpfx

@dmitryax
Copy link
Member

Also the issue link (#5243) seems to be wrong, that one is a PR to fix load metrics, not CPU

@dmitryax
Copy link
Member

Should we also mention these configuration options to the README?

@dloucasfx
Copy link
Contributor Author

Also the issue link (#5243) seems to be wrong, that one is a PR to fix load metrics, not CPU

I just referenced it as the request came in from the same user who is trying to accomplish the same task

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

LGTM. It would be nice to have these examples mentioned in the docs

@dloucasfx
Copy link
Contributor Author

LGTM. It would be nice to have these examples mentioned in the docs

ok, I will add a few

@tigrannajaryan
Copy link
Member

@dloucasfx make sure the unit tests pass, they are failing now and it appears it caused by this change.

@@ -131,6 +131,18 @@ exporters:
state: [interrupt, user, system]
```

The following example sends "per core" only `cpu.interrupt` metrics, the aggregated and "per core" `cpu.idle` metrics:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind rephrasing with more specificity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure how to be more specific, do you want an example of the datapoints?
This is what the datapoints look like with the config, 3 for cpu.idle ( 2 per core with dim cpu + 1 aggregated) and 2 for cpu.interrupt (2 per core with dim cpu NO aggregated metric)

2021-10-15T01:28:08.397Z	debug	signalfxexporter@v0.36.0/dpclient.go:104	Dispatching SFx datapoint	{"kind": "exporter", "name": "signalfx", "dp": "cpu.idle: intValue:2010766  (Cumulative Counter) 1634261288187\nkey:\"host.name\" value:\"angus-ad.adlab.com\" key:\"os.type\" value:\"LINUX\" key:\"cpu\" value:\"cpu0\" "}
2021-10-15T01:28:08.397Z	debug	signalfxexporter@v0.36.0/dpclient.go:104	Dispatching SFx datapoint	{"kind": "exporter", "name": "signalfx", "dp": "cpu.interrupt: intValue:256  (Cumulative Counter) 1634261288187\nkey:\"host.name\" value:\"angus-ad.adlab.com\" key:\"os.type\" value:\"LINUX\" key:\"cpu\" value:\"cpu0\" "}
2021-10-15T01:28:08.397Z	debug	signalfxexporter@v0.36.0/dpclient.go:104	Dispatching SFx datapoint	{"kind": "exporter", "name": "signalfx", "dp": "cpu.idle: intValue:2010075  (Cumulative Counter) 1634261288187\nkey:\"host.name\" value:\"angus-ad.adlab.com\" key:\"os.type\" value:\"LINUX\" key:\"cpu\" value:\"cpu1\" "}
2021-10-15T01:28:08.397Z	debug	signalfxexporter@v0.36.0/dpclient.go:104	Dispatching SFx datapoint	{"kind": "exporter", "name": "signalfx", "dp": "cpu.interrupt: intValue:523  (Cumulative Counter) 1634261288187\nkey:\"host.name\" value:\"angus-ad.adlab.com\" key:\"os.type\" value:\"LINUX\" key:\"cpu\" value:\"cpu1\" "}
2021-10-15T01:28:08.397Z	debug	signalfxexporter@v0.36.0/dpclient.go:104	Dispatching SFx datapoint	{"kind": "exporter", "name": "signalfx", "dp": "cpu.idle: intValue:4020841  (Cumulative Counter) 1634261288187\nkey:\"host.name\" value:\"angus-ad.adlab.com\" key:\"os.type\" value:\"LINUX\" "}

Signed-off-by: Dani Louca <dlouca@splunk.com>
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.

7 participants