There seem to be many duplicated metrics exported from the Otel collector to AWS cloud watch which generates a significant cost. Today on a sample deployment with 1 BFE instance and 1 bidding instance I can see over 500 metrics. AWS bills each metric 0.3 USD which means 150 USD cost alone and this doesn't even include the data storage cost and querying cost.
[{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'telemetry.sdk.language', 'Value': 'cpp'},
{'Name': 'service.name', 'Value': 'bfe'},
{'Name': 'service.instance.id', 'Value': 'i-my-instance-id'},
{'Name': 'service.version', 'Value': '4.7.0'},
{'Name': 'Noise', 'Value': 'Raw'},
{'Name': 'generation_id', 'Value': 'not_consented'},
{'Name': 'telemetry.sdk.version', 'Value': '1.9.1'},
{'Name': 'region', 'Value': 'us-west-1'},
{'Name': 'OTelLib', 'Value': 'bfe'},
{'Name': 'deployment.environment', 'Value': 'prd'},
{'Name': 'operator', 'Value': 'criteo'},
{'Name': 'telemetry.sdk.name', 'Value': 'opentelemetry'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'generation_id', 'Value': 'not_consented'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'telemetry.sdk.version', 'Value': '1.9.1'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'Noise', 'Value': 'Raw'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'service.version', 'Value': '4.7.0'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'region', 'Value': 'us-west-1'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'OTelLib', 'Value': 'bfe'},
{'Name': 'operator', 'Value': 'criteo'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'telemetry.sdk.language', 'Value': 'cpp'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'generation_id', 'Value': 'A-UUID'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'telemetry.sdk.language', 'Value': 'cpp'},
{'Name': 'service.instance.id', 'Value': 'i-my-instance-id'},
{'Name': 'service.name', 'Value': 'bfe'},
{'Name': 'service.version', 'Value': '4.7.0'},
{'Name': 'generation_id', 'Value': 'A-UUID'},
{'Name': 'Noise', 'Value': 'Raw'},
{'Name': 'telemetry.sdk.version', 'Value': '1.9.1'},
{'Name': 'region', 'Value': 'us-west-1'},
{'Name': 'OTelLib', 'Value': 'bfe'},
{'Name': 'operator', 'Value': 'criteo'},
{'Name': 'deployment.environment', 'Value': 'prd'},
{'Name': 'telemetry.sdk.name', 'Value': 'opentelemetry'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'OTelLib', 'Value': 'bfe'},
{'Name': 'deployment.environment', 'Value': 'prd'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'OTelLib', 'Value': 'bfe'},
{'Name': 'telemetry.sdk.name', 'Value': 'opentelemetry'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'service.name', 'Value': 'bfe'},
{'Name': 'OTelLib', 'Value': 'bfe'}]},
{'Namespace': 'bfe',
'MetricName': 'request.count',
'Dimensions': [{'Name': 'service.instance.id',
'Value': 'i-my-instance-id'},
{'Name': 'OTelLib', 'Value': 'bfe'}]}]
It seems to be duplicated 15 times and all send the same value except the metrics with {'Name': 'generation_id', 'Value': 'A-UUID'} which corresponds to one consented request that has been sent a long time ago and therefore gets collected as 0.
There seem to be many duplicated metrics exported from the Otel collector to AWS cloud watch which generates a significant cost. Today on a sample deployment with 1 BFE instance and 1 bidding instance I can see over 500 metrics. AWS bills each metric 0.3 USD which means 150 USD cost alone and this doesn't even include the data storage cost and querying cost.
When look at just one metric
request.countI get this:It seems to be duplicated 15 times and all send the same value except the metrics with
{'Name': 'generation_id', 'Value': 'A-UUID'}which corresponds to one consented request that has been sent a long time ago and therefore gets collected as 0.Most dimensions, except maybe
instance_id, look redundant. I already know that I'm criteo, I already know that I'm in us-west-1 as this is a parameter to the CloudWatch query and I already know via the namespace that I'm querying the bfe.But as they are always the same I would still except to see this metric exactly once with all dimensions and then replicated for different modalities.
So taking into account the current behavior of generation_id (reported here), that I have sent 1 consented request a long time ago, that I have only 1 bfe instance I would expect only 2 lines here one with the actual number of requests that the instance received and one with 0. But it seems not to be the case.