Skip to content

Support for default dimensions #147

Description

@DahShahar

Hi, sorry in advance if this is already something supported by the library and I couldn't find it.

What?

I'm trying to override the default dimensions to remove things that aren't useful to me, such as LogGroup and ServiceType.

I can't find a way to actually do this. I see from the Configuration in the README that I can set namespace which is also useful, but not enough.

I thought there'd be a similar way to handle Dimensions, but there aren't. Ideally, I'd like to be able to create a single MetricsLogger in my application and wire it in as needed. That logger should always have the dimensions I want as baseline, and some methods might add more.

I recognize that this wouldn't work for an environment variable configuration, but how about something like:

const { Configuration } = require("aws-embedded-metrics");

Configuration.dimensions = [{
    version: 'N+1' // Latest Lambda Version specific
  },
  {}  // Whole fleet metrics
];

This would allow me to alarm on both the "latest" Lambda version specific metrics, and the fleet as a whole as I'd be emitting metrics for both at the same rate. This is especially useful during deployments as I want to see how the newest version is doing.

An alternative would be to open up the constructor of the MetricsLogger. I see that it is technically public today, but we don't have access to the EnvironmentProvider (again, as far as I am able to tell).

Let me know what you think, and if there's already a way to do this I apologize in advance.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions