Created
September 13, 2025 12:23
-
-
Save ngotzmann/2f1368e63dfd7129a76ef13bd3051a24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sendDummyMetric(config: any) { | |
| const otelRequest = { | |
| resource_metrics: [ | |
| { | |
| resource: { | |
| attributes: [ | |
| { key: 'service.name', value: { string_value: 'k6-otlp-test' } }, | |
| ], | |
| }, | |
| scope_metrics: [ | |
| { | |
| scope: { name: 'k6' }, | |
| metrics: [ | |
| { | |
| name: 'k6_dummy_metric', | |
| description: 'a test metric sent by k6 test', | |
| unit: '1', | |
| gauge: { | |
| data_points: [ | |
| { | |
| attributes: [{ key: 'env', value: { string_value: 'k6-dev' } }], | |
| as_double: 42.0 | |
| } | |
| ], | |
| }, | |
| }, | |
| ], | |
| }, | |
| ], | |
| }, | |
| ], | |
| }; | |
| const headers = { headers: { 'Content-Type': 'application/json' } }; | |
| const res = http.post(config.group_vars.otel_url, JSON.stringify(otelRequest), headers); | |
| expect(res.status).to.be.equal(200); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment