EmfMetricLoggingPublisher: Support multiple dimensionsets for metrics

Open
#7,184 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
56/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
aws, java

Research direction

Start with EmfMetricLoggingPublisher and its Builder, then read the existing dimensions options and the PropertiesFactory pattern in the linked API documentation. Define how a DimensionSetsFactory is supplied and how existing dimension settings continue to work. Done means metrics can emit multiple EMF DimensionSets while preserving current single-dimension behavior.

Written by the indexing model from the issue text.

Description

feature-request p2 sdk-metrics
Describe the feature

The existing EmfMetricLoggingPublisher currently supports a single set of dimensions for metrics. The EMF format supports an array of DimensionSet for each metric to allow metrics to be rolled up at different granularity.

Use Case

I'd like to be able to report client metrics rolled up for the entire service and also report them rolled up per api operation in that service.

e.g. for FooService with operations foo and bar, I'd like to have metrics reporting the DynamoDB query latency with the DimensionSets below

  • [Service=FooService, Client=DDB, ClientOperation=Query]
    • Service level
  • [Service=FooService, Operation=[foo|bar], Client=DDB, ClientOperation=Query]
    - Service+Operation level

Note: In order to provide the Context to the EmfMetricLoggingPublisher as to which Service Operation is running, that is possible today with a client interceptor that adds a custom SDK metric to the call which is capable of propagating whatever context is needed to produce these dimensions. That is functionally how I plan to bridge service level context information into the MetricCollection that the publisher has access to.

Proposed Solution

Add an additional field on the builder to support a DimensionSetsFactory which follows the same pattern as the PropertiesFactory. The existing dimensions options would continue to work as they do today with them producing DimensionSetsFactory internally allowing the publisher to consistently adopt the DimensionSetsFactory internally for producing metric dimensions.

Alternatively one could update the builder to accept a Collection of DimenionSets rather than just a single DimensionSet but the factory may prove more flexible for consumers.

Other Information

No response

Acknowledgements
  • I may be able to implement this feature request
  • This feature might incur a breaking change
AWS Java SDK version used

2

JDK version used

21

Operating System and version

linux

Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 17h
Merged PRs (30d)
39

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-sdk-java-v2

All issues in aws/aws-sdk-java-v2

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.