Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Prometheus remote write receiver compatible with sfx gateway #3064

Merged
merged 56 commits into from
May 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d189b6f
Add initial prometheus translation logic, for only sfx compatibility
hughesjj Apr 26, 2023
911a625
add timeout to test client
hughesjj May 4, 2023
813090a
refactor naming for test helpers
hughesjj May 4, 2023
ca43691
more comprehensive testing
hughesjj May 4, 2023
3bb2811
make fmt
hughesjj May 4, 2023
e0e6fde
I think this matches what we do with nans, reporting the metric but n…
hughesjj May 4, 2023
e9cd002
add comment about metricdata support
hughesjj May 4, 2023
3abc8f9
Think this fixes remaining issues with accounting on sfx specific err…
hughesjj May 4, 2023
d8abaed
move scopemetrics up
hughesjj May 4, 2023
2d46aca
ahh histograms
hughesjj May 4, 2023
b76ba59
expand readme to reflect things no longer reported
hughesjj May 4, 2023
574c4d8
test timestamps too, can handle better test pattern later
hughesjj May 4, 2023
c36e7a0
tidy commit
hughesjj May 4, 2023
45072ca
godoc format some docstrings in utils
hughesjj May 4, 2023
5ea3075
rename utils to something more meaningful (prometheus_spec_utils)
hughesjj May 4, 2023
dbae0cf
remove stateset, add documentation for the newly releases PRW spec 1.0
hughesjj May 4, 2023
bd70c67
reduce timeout in test
hughesjj May 4, 2023
5abd8de
remote outdated comment
hughesjj May 4, 2023
58a5db1
more comment and test cleanup
hughesjj May 4, 2023
264dde2
remove logs from test
hughesjj May 4, 2023
4e6a7ce
add test for summary
hughesjj May 4, 2023
ca6b1cc
fix test for summary
hughesjj May 4, 2023
a2c2329
fix docstring
hughesjj May 4, 2023
78e25f8
Update internal/receiver/prometheusremotewritereceiver/config.go
hughesjj May 4, 2023
e14033b
Update internal/receiver/prometheusremotewritereceiver/README.md
hughesjj May 4, 2023
9defbdf
PR feedback
hughesjj May 4, 2023
e11a4f5
Make Readme more accurate
hughesjj May 4, 2023
92e2bdf
bit more comprehensive tsting of metric recipience. Would love to ad…
hughesjj May 5, 2023
3b4ef37
test some error cases as well
hughesjj May 5, 2023
8d5b3e5
PR Feedback on prometheus_spec_utils
hughesjj May 7, 2023
32fecf2
de-export some things
hughesjj May 7, 2023
70539b5
combine write request fixtures into single _test file
hughesjj May 7, 2023
bfbe16c
remove set in favor of map in test
hughesjj May 7, 2023
6df70ba
use map equality instead of set comparison -- but stop caring about o…
hughesjj May 7, 2023
c4d8774
rework readme to conform to new shape
hughesjj May 7, 2023
2f82738
make fmt
hughesjj May 7, 2023
9a275b8
rename receiver
hughesjj May 7, 2023
7287c77
rename typestring to signalfxgatewayprometheusremotewrite
hughesjj May 7, 2023
aa1b1a5
adopt new receiver into components
hughesjj May 7, 2023
2a2e8ca
fix lint
hughesjj May 7, 2023
bc3f427
mdatagen alignment
hughesjj May 7, 2023
0d0afaf
add an example for running sfx gateway prometheus remote write receiver
hughesjj May 7, 2023
90339c0
aha, thought so. anyway new convienence methods to prevent this
hughesjj May 8, 2023
e6ee90f
needs makefile to pass forall command in workflows
hughesjj May 8, 2023
514be69
change logging config due to deprecated setting
hughesjj May 8, 2023
59ee3de
ensure we set telemetry settings
hughesjj May 8, 2023
ec92702
ah, telemetry endpoint conflicts. Looking into what that setting act…
hughesjj May 8, 2023
ed057ab
oops, misread, we actually don't want this particular one set (MeterP…
hughesjj May 8, 2023
5778e40
allow for more retries...
hughesjj May 8, 2023
9deee61
add license to example golang file & other various cleanup of example
hughesjj May 8, 2023
55a9e90
another lint check... think I need to test with for-all locally and n…
hughesjj May 8, 2023
1f49e2c
get rid of anything to do with metricfamily name and fully adhere to …
hughesjj May 8, 2023
34bb393
lintfixes
hughesjj May 8, 2023
9c2f54e
cleanup README and lingering comments pre merge (hopefully 🤞)
hughesjj May 8, 2023
a6ecef7
Update internal/receiver/signalfxgatewayprometheusremotewritereceiver…
hughesjj May 8, 2023
0e428ea
use errors not fmt
hughesjj May 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test timestamps too, can handle better test pattern later
hughesjj committed May 4, 2023
commit 574c4d88ca9137616d8d89d8961bd1c0117947d3
Original file line number Diff line number Diff line change
@@ -197,18 +197,18 @@ func ExpectedSfxCompatibleHistogram() pmetric.Metrics {
// set bucket sizes
pairs := []struct {
bucket string
value float64
value int64
timestamp int64
}{
{
bucket: "0.1",
value: 500,
timestamp: Jan20.UnixMilli(),
timestamp: Jan20.UnixNano(),
},
{
bucket: "0.2",
value: 1500,
timestamp: Jan20.UnixMilli(),
timestamp: Jan20.UnixNano(),
},
}
for _, values := range pairs {
@@ -218,9 +218,10 @@ func ExpectedSfxCompatibleHistogram() pmetric.Metrics {
counter.SetIsMonotonic(true)
counter.SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
dp := counter.DataPoints().AppendEmpty()
dp.Attributes().PutStr("le", values.bucket)
dp.SetTimestamp(pcommon.Timestamp(values.timestamp))
dp.SetStartTimestamp(pcommon.Timestamp(values.timestamp))
dp.SetDoubleValue(values.value)
dp.SetIntValue(values.value)
}

metric := scopeMetrics.Metrics().AppendEmpty()
@@ -229,8 +230,8 @@ func ExpectedSfxCompatibleHistogram() pmetric.Metrics {
counter.SetIsMonotonic(true)
counter.SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
dp := counter.DataPoints().AppendEmpty()
dp.SetTimestamp(pcommon.Timestamp(Jan20.UnixMilli()))
dp.SetStartTimestamp(pcommon.Timestamp(Jan20.UnixMilli()))
dp.SetTimestamp(pcommon.Timestamp(Jan20.UnixNano()))
dp.SetStartTimestamp(pcommon.Timestamp(Jan20.UnixNano()))
dp.SetIntValue(2500)

metric = scopeMetrics.Metrics().AppendEmpty()
@@ -240,9 +241,9 @@ func ExpectedSfxCompatibleHistogram() pmetric.Metrics {
counter.SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
dp = counter.DataPoints().AppendEmpty()

dp.SetTimestamp(pcommon.Timestamp(Jan20.UnixMilli()))
dp.SetStartTimestamp(pcommon.Timestamp(Jan20.UnixMilli()))
dp.SetDoubleValue(350)
dp.SetTimestamp(pcommon.Timestamp(Jan20.UnixNano()))
dp.SetStartTimestamp(pcommon.Timestamp(Jan20.UnixNano()))
dp.SetIntValue(350)

return result
}
@@ -280,7 +281,10 @@ func addSfxCompatibilityInvalidRequestMetrics(scopeMetrics pmetric.ScopeMetrics,
counter := metric.SetEmptySum()
counter.SetIsMonotonic(true)
counter.SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
counter.DataPoints().AppendEmpty().SetIntValue(value)
dp := counter.DataPoints().AppendEmpty()
dp.SetIntValue(value)
dp.SetStartTimestamp(pcommon.NewTimestampFromTime(Jan20))
dp.SetTimestamp(pcommon.NewTimestampFromTime(Jan20))
return metric
}

@@ -292,7 +296,10 @@ func addSfxCompatibilityMissingNameMetrics(scopeMetrics pmetric.ScopeMetrics, va
counter := metric.SetEmptySum()
counter.SetIsMonotonic(true)
counter.SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
counter.DataPoints().AppendEmpty().SetIntValue(value)
dp := counter.DataPoints().AppendEmpty()
dp.SetIntValue(value)
dp.SetStartTimestamp(pcommon.NewTimestampFromTime(Jan20))
dp.SetTimestamp(pcommon.NewTimestampFromTime(Jan20))
return metric
}

@@ -304,7 +311,10 @@ func addSfxCompatibilityNanMetrics(scopeMetrics pmetric.ScopeMetrics, value int6
counter := metric.SetEmptySum()
counter.SetIsMonotonic(true)
counter.SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
counter.DataPoints().AppendEmpty().SetIntValue(value)
dp := counter.DataPoints().AppendEmpty()
dp.SetIntValue(value)
dp.SetStartTimestamp(pcommon.NewTimestampFromTime(Jan20))
dp.SetTimestamp(pcommon.NewTimestampFromTime(Jan20))
return metric
}

Original file line number Diff line number Diff line change
@@ -166,8 +166,6 @@ func TestAddMetricsHappyPath(t *testing.T) {

require.NoError(t, pmetrictest.CompareMetrics(tc.Expected, actual,
pmetrictest.IgnoreMetricDataPointsOrder(),
pmetrictest.IgnoreStartTimestamp(),
pmetrictest.IgnoreTimestamp(),
pmetrictest.IgnoreMetricsOrder()))
})