Skip to content

Commit

Permalink
[otlp] add optional min/max fields to histograms (#5399)
Browse files Browse the repository at this point in the history
* [otlp] add optional min/max fields to histograms

Fixes #5380

* update changelog

* don't bother defining reusable variables
  • Loading branch information
Alex Boten authored May 19, 2022
1 parent 95c5f4d commit c56d20e
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
### 💡 Enhancements 💡

- Update OTLP to v0.17.0 (#5335)
- Add optional min/max fields to histograms (#5399)

### 🧰 Bug fixes 🧰

Expand Down
36 changes: 36 additions & 0 deletions pdata/internal/cmd/pdatagen/internal/metrics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,24 @@ var histogramDataPoint = &messageValueStruct{
explicitBoundsField,
exemplarsField,
dataPointFlagsField,
&optionalPrimitiveValue{
fieldName: "Min",
fieldType: "Double",
originFieldName: "Min",
originTypePrefix: "otlpmetrics.HistogramDataPoint_",
returnType: "float64",
defaultVal: "float64(0.0)",
testVal: "float64(9.23)",
},
&optionalPrimitiveValue{
fieldName: "Max",
fieldType: "Double",
originFieldName: "Max",
originTypePrefix: "otlpmetrics.HistogramDataPoint_",
returnType: "float64",
defaultVal: "float64(0.0)",
testVal: "float64(182.55)",
},
},
}

Expand Down Expand Up @@ -338,6 +356,24 @@ var exponentialHistogramDataPoint = &messageValueStruct{
},
exemplarsField,
dataPointFlagsField,
&optionalPrimitiveValue{
fieldName: "Min",
fieldType: "Double",
originFieldName: "Min",
originTypePrefix: "otlpmetrics.ExponentialHistogramDataPoint_",
returnType: "float64",
defaultVal: "float64(0.0)",
testVal: "float64(9.23)",
},
&optionalPrimitiveValue{
fieldName: "Max",
fieldType: "Double",
originFieldName: "Max",
originTypePrefix: "otlpmetrics.ExponentialHistogramDataPoint_",
returnType: "float64",
defaultVal: "float64(0.0)",
testVal: "float64(182.55)",
},
},
}

Expand Down
80 changes: 80 additions & 0 deletions pdata/internal/generated_pmetric.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions pdata/internal/generated_pmetric_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c56d20e

Please sign in to comment.