-
Notifications
You must be signed in to change notification settings - Fork 78
[BUG] Metrics view uses the "time" field for filtering which is inconsistent with the SS4O schema #2581
Description
What is the bug?
The SS4O metrics mapping doesn't list a top-level time field, but it is used by the observability dashboard to display metrics. As a result, documents that don't contain the time field are completely filtered out. This seems to be inconsistent with the SS4O template that doesn't contain the time field.
Note: this is my observation when I had a leftover rename from time to @timestamp coming from before I started using the unified source in Data Prepper (OSIS). Currently, the data I have contains both time and @timestamp, but I'm still confused by the lack of time in the reference mapping and unsure if using the time field is a well-defined behavior.
How can one reproduce the bug?
- Configure a datastream using the reference mapping: https://github.com/opensearch-project/opensearch-catalog/blob/main/schema/observability/metrics/1.0.1/metrics-datastream-1.0.1.mapping
- Push a document with histogram and with the
@timestampfield instead oftimeto thess4o_metrics-otel-defaultindex. - Go to Metrics view, select a specific metric. The labels on X-axis are present, but no bars are rendered.
What is the expected behavior?
The @timestamp is used for filtering the documents.
What is your host/environment?
Setup 1:
- OS: Linux
- Version: OpenSearch 3.4.0 (official docker image)
Setup 2:
- AWS
- Version: OpenSearch 3.3 (latest); Service software version: OpenSearch_3_3_R20251121-P3 (latest)
Do you have any screenshots?
Do you have any additional context?
The filtering is applied here:
| time: { |
Sample document to reproduce the issue
{
"metadata": {},
"instrumentationScope": {
"name": "__main__",
"droppedAttributesCount": 0
},
"max": 0,
"resource": {
"droppedAttributesCount": 0,
"attributes": {
"telemetry.sdk.language": "python",
"service.name": "histogram-metrics-generator",
"telemetry.sdk.version": "1.39.1",
"service.namespace": "testing",
"telemetry.sdk.name": "opentelemetry"
},
"schemaUrl": ""
},
"kind": "HISTOGRAM",
"buckets": [
{
"min": -3.4028234663852886e+38,
"max": 10,
"count": 0
},
{
"min": 10,
"max": 25,
"count": 1
},
{
"min": 25,
"max": 50,
"count": 4
},
{
"min": 50,
"max": 100,
"count": 32
},
{
"min": 100,
"max": 150,
"count": 6
},
{
"min": 150,
"max": 200,
"count": 0
},
{
"min": 200,
"max": 250,
"count": 0
},
{
"min": 250,
"max": 300,
"count": 0
},
{
"min": 300,
"max": 400,
"count": 0
},
{
"min": 400,
"max": 500,
"count": 0
},
{
"min": 500,
"max": 750,
"count": 0
},
{
"min": 750,
"max": 1000,
"count": 0
},
{
"min": 1000,
"max": 1500,
"count": 0
},
{
"min": 1500,
"max": 2000,
"count": 0
},
{
"min": 2000,
"max": 3000,
"count": 0
},
{
"min": 3000,
"max": 5000,
"count": 0
},
{
"min": 5000,
"max": 3.4028234663852886e+38,
"count": 0
}
],
"count": 43,
"bucketCountsList": [
0,
0,
1,
0,
2,
1,
18,
18,
3,
0,
0,
0,
0,
0,
0
],
"flags": 0,
"description": "Database query duration in milliseconds",
"sum": 2155.8211954598473,
"schemaUrl": "",
"unit": "",
"aggregationTemporality": "AGGREGATION_TEMPORALITY_UNSPECIFIED",
"min": 0,
"exemplars": {},
"bucketCounts": 15,
"name": "database.query.duration",
"startTime": "1970-01-01T00:00:00Z",
"explicitBoundsCount": 14,
"attributes": {
"query_type": "UPDATE",
"device.id": "a2c108c2-ae27-449f-a1b9-0ba11938a2f9",
"table": "inventory"
},
"explicitBounds": [
5,
10,
15,
20,
25,
30,
50,
75,
100,
150,
200,
300,
500,
1000
],
"@timestamp": "2026-02-02T12:16:24.827740305Z"
}