Skip to content

Conversation

@tmeijn
Copy link
Contributor

@tmeijn tmeijn commented Dec 5, 2025

PR Description

This PR adds job level period, length, and add_cloudwatch_timestamp support to both discovery and custom namespace jobs. Futhermore it expose a top level labels_snake_case option.

Which issue(s) this PR fixes

Closes #398

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

Period time.Duration `alloy:"period,attr,optional"`
Length time.Duration `alloy:"length,attr,optional"`
Delay time.Duration `alloy:"delay,attr,optional"`
//TODO: Remove NilToZero, because it is deprecated upstream.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought: I actually could not find any reference to this being a deprecated options, not in the YACE docs nor in the code itself so decided to remove these TODOs.

DimensionNameRequirements: rj.DimensionNameRequirements,
// By setting RoundingPeriod to nil, the exporter will align the start and end times for retrieving CloudWatch
// metrics, with the smallest period in the retrieved batch.
RoundingPeriod: nil,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought: during writing and fixing of tests I often found myself switching a lot between the the alloy config and the expected model so I decided to:

  1. re-order the tests a bit more logically
  2. Move the expected model close to the input Alloy config

IMHO this makes it bit easier to find the relation between the config and expected model and makes it easier to debug when a test is failing.

Let me know if y'all have other thoughts.

}

func toYACEMetrics(ms []Metric, jobNilToZero *bool) []*yaceConf.Metric {
func toYACEMetrics(ms []Metric, jobPeriod time.Duration, jobLength time.Duration) []*yaceConf.Metric {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

question/thought: AFAICT, basically to only reason we still need this function is because in Alloy we decided to automatically align the length with the period window if the length is not defined.

As this is something that YACE does not do, do we actively want to patch a different behavior from upstream in Alloy?

@tmeijn
Copy link
Contributor Author

tmeijn commented Dec 5, 2025

Hey @kgeckhart hope you don't mind me tagging you directly: If you wouldn't mind, could you give me your thoughts on this PR? Is this something Grafana Alloy would like as a contribution?

This PR still requires some final polish, but would like a general opinion on the direction.

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.

Expose more configuration options for prometheus.exporter.cloudwatch component

1 participant