data-prepper icon indicating copy to clipboard operation
data-prepper copied to clipboard

data is not stored in the format of [<metric_name>: <value>] in OpenSearch.

Open mothercow-dev opened this issue 1 year ago • 5 comments

Versions: opensearch & opensearch dashboard 2.11.1 data-prepper 2.6.1 opentelemetry-collector-contrib 0.92.0

When utilizing DataPrepper's metric pipeline to transmit data collected through OpenTelemetry to OpenSearch, the data is not stored in the format of <metric_name> : <value> in OpenSearch.

OTLE collector to collect kubelet data. If you check in the opensearch dashboard, the metric name is stored in the name field.

{
   name: <metric_name>
   value: <value>
}

It seems to save as

I want to easily use the visualization features you provide.

{ 
    <metric_name>: <value>
}

, is it possible to change it to something like this?

[name field] 스크린샷 2024-03-14 오후 3 40 48

[data-prepper config] 스크린샷 2024-03-14 오후 3 43 34

mothercow-dev avatar Mar 14 '24 07:03 mothercow-dev

The issue here is the limitations to 1000 fields per index. If your suggestion is followed, this limit will be reached pretty fast. Additionally, this creates a lot of sparse fields, which might impact performance badly. Also note, that the current format follows the OpenTelemetry metrics data model.

KarstenSchnitter avatar Mar 14 '24 09:03 KarstenSchnitter

@mothercow-dev , The point that @KarstenSchnitter made is good and explains the reason why we do it this way.

Because of that, I don't think we would support this in the otel_metrics source and processor. However, you could use a processor to make the transformation. I would not suggest that because of the issues @KarstenSchnitter made, but it would be possible.

Is there a particular reason you want this format?

dlvenable avatar Mar 19 '24 19:03 dlvenable

@KarstenSchnitter , Thank you

@dlvenable , While creating a Visualize for opensearchd, I was not seeing the metric name of the kubeletstatreceiver collected in Available fields, so I asked a question.

As I understand it, when I create a Visualize, I can create it through the values in Available fields.

Based on your description, can I use the processor in data-prepper to convert it to what I want? <metric_name> : <value>

mothercow-dev avatar Mar 21 '24 01:03 mothercow-dev

I am currently working on a dashboard for the kubeletstatreceiver metrics in OpenSearch with data ingested via DataPrepper. You can use saved searches to filter by the name field or use the filters aggregation, that supports arbitrary DQL expressions. If you use TSVB visualizations, you can provide a global DQL expression for the visualization. This allows to visualize the value of the data points quite nicely.

@dlvenable do you think, it would make sense to write an OpenSearch blog post about visualizing metrics data ingested that way? @mothercow-dev would that be helpful to you?

KarstenSchnitter avatar Mar 22 '24 16:03 KarstenSchnitter

HI,

@KarstenSchnitter It will be a great help in configuring visualizations in opensearch dashboards.

mothercow-dev avatar Mar 26 '24 00:03 mothercow-dev