-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor tests to remove all UDP that is hardcoded #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good!! It might be definitly a good Idea to separate it in 2 PR , perhaps one doing the refactoring with not feature added or fixed and the other one with the new feature.
15e068e
to
96846f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments, merely nits but I think this is almost ready. Great job!
Before submitting the PR I would try to explain why the changes are needed (the plan to support additional protocols) and what is changed: mainly hardcoded references are removed from tests but there are other changes: the Transport
type is introduced and an unused reference from UdpServer
is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job here! Just added a best practice nit.
Host string | ||
Port int | ||
Conn io.Writer | ||
transport string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why string and not type Transport string
as defined in transport.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circular dependencies.
@@ -42,33 +34,22 @@ func NewStatsD(transport Transport, host string, port int) (*StatsD, error) { | |||
} | |||
|
|||
// connect populates the StatsD.Conn | |||
func (s *StatsD) connect(transport Transport) error { | |||
if cl, ok := s.Conn.(io.Closer); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a curiosity, what were they doing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't know. while testing, the client was closing the connection before start sending any data. It makes no sense and it was giving issues with the socket as it started to close it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just nits, well done!
…emetry#24676) **Description:** The metadata.yml for the SSH check receiver currently documents a resource attribute containing the SSH endpoint but this is not emitted. This PR updates the receiver to include this resource attribute. **Link to tracking Issue:** open-telemetry#24441 **Testing:** Example collector config: ```yaml receivers: sshcheck: endpoint: 13.245.150.131:22 username: ec2-user key_file: /Users/dewald.dejager/.ssh/sandbox.pem collection_interval: 15s known_hosts: /Users/dewald.dejager/.ssh/known_hosts ignore_host_key: false resource_attributes: "ssh.endpoint": enabled: true exporters: logging: verbosity: detailed prometheus: endpoint: 0.0.0.0:8081 resource_to_telemetry_conversion: enabled: true service: pipelines: metrics: receivers: [sshcheck] exporters: [logging, prometheus] ``` The log output looks like this: ``` 2023-07-30T16:52:38.724+0200 info MetricsExporter {"kind": "exporter", "data_type": "metrics", "name": "logging", "resource metrics": 1, "metrics": 2, "data points": 2} 2023-07-30T16:52:38.724+0200 info ResourceMetrics #0 Resource SchemaURL: Resource attributes: -> ssh.endpoint: Str(13.245.150.131:22) ScopeMetrics #0 ScopeMetrics SchemaURL: InstrumentationScope otelcol/sshcheckreceiver 0.82.0-dev Metric #0 Descriptor: -> Name: sshcheck.duration -> Description: Measures the duration of SSH connection. -> Unit: ms -> DataType: Gauge NumberDataPoints #0 StartTimestamp: 2023-07-30 14:52:22.381672 +0000 UTC Timestamp: 2023-07-30 14:52:38.404003 +0000 UTC Value: 319 Metric #1 Descriptor: -> Name: sshcheck.status -> Description: 1 if the SSH client successfully connected, otherwise 0. -> Unit: 1 -> DataType: Sum -> IsMonotonic: false -> AggregationTemporality: Cumulative NumberDataPoints #0 StartTimestamp: 2023-07-30 14:52:22.381672 +0000 UTC Timestamp: 2023-07-30 14:52:38.404003 +0000 UTC Value: 1 ``` And the Prometheus metrics look like this: ``` # HELP sshcheck_duration Measures the duration of SSH connection. # TYPE sshcheck_duration gauge sshcheck_duration{ssh_endpoint="13.245.150.131:22"} 311 # HELP sshcheck_status 1 if the SSH client successfully connected, otherwise 0. # TYPE sshcheck_status gauge sshcheck_status{ssh_endpoint="13.245.150.131:22"} 1 ```
) **Description:** Adding command line argument `--status-code` to `telemetrygen traces`, which accepts `(Unset,Error,Ok)` (case sensitive) or the enum equivalent of `(0,1,2)`. Running ```shell telemetrygen traces --otlp-insecure --traces 1 --status-code 1 ``` against a minimal local collector yields ```txt 2023-07-29T21:27:57.862+0100 info ResourceSpans #0 Resource SchemaURL: https://opentelemetry.io/schemas/1.4.0 Resource attributes: -> service.name: Str(telemetrygen) ScopeSpans #0 ScopeSpans SchemaURL: InstrumentationScope telemetrygen Span #0 Trace ID : f6dc4be32c78b9999c69d504a79e68c1 Parent ID : 4e2cd6e0e90cf2ea ID : 20835413e32d26a5 Name : okey-dokey Kind : Server Start time : 2023-07-29 20:27:57.861602 +0000 UTC End time : 2023-07-29 20:27:57.861726 +0000 UTC Status code : Error Status message : Attributes: -> net.peer.ip: Str(1.2.3.4) -> peer.service: Str(telemetrygen-client) Span #1 Trace ID : f6dc4be32c78b9999c69d504a79e68c1 Parent ID : ID : 4e2cd6e0e90cf2ea Name : lets-go Kind : Client Start time : 2023-07-29 20:27:57.861584 +0000 UTC End time : 2023-07-29 20:27:57.861726 +0000 UTC Status code : Error Status message : Attributes: -> net.peer.ip: Str(1.2.3.4) -> peer.service: Str(telemetrygen-server) ``` and similarly (the string version) ```shell telemetrygen traces --otlp-insecure --traces 1 --status-code '"Ok"' ``` produces ```txt Resource SchemaURL: https://opentelemetry.io/schemas/1.4.0 Resource attributes: -> service.name: Str(telemetrygen) ScopeSpans #0 ScopeSpans SchemaURL: InstrumentationScope telemetrygen Span #0 Trace ID : dfd830da170acfe567b12f87685d7917 Parent ID : 8e15b390dc6a1ccc ID : 165c300130532072 Name : okey-dokey Kind : Server Start time : 2023-07-29 20:29:16.026965 +0000 UTC End time : 2023-07-29 20:29:16.027089 +0000 UTC Status code : Ok Status message : Attributes: -> net.peer.ip: Str(1.2.3.4) -> peer.service: Str(telemetrygen-client) Span #1 Trace ID : dfd830da170acfe567b12f87685d7917 Parent ID : ID : 8e15b390dc6a1ccc Name : lets-go Kind : Client Start time : 2023-07-29 20:29:16.026956 +0000 UTC End time : 2023-07-29 20:29:16.027089 +0000 UTC Status code : Ok Status message : Attributes: -> net.peer.ip: Str(1.2.3.4) -> peer.service: Str(telemetrygen-server) ``` The default is `Unset` which is the current behaviour. **Link to tracking Issue:** 24286 **Testing:** Added unit tests which covers both valid and invalid inputs. **Documentation:** Command line arguments are self documenting via the usage info in the flag. Co-authored-by: Pablo Baeyens <[email protected]>
7094a68
to
e4f8238
Compare
e4f8238
to
4fa23ed
Compare
open-telemetry#28637) Fixed a typo in README.md, in the example: **Before:** traces/in: receivers: [_**oltp**_] exporters: [routing] **After:** traces/in: receivers: [_**otlp**_] exporters: [routing]
See [design document](https://docs.google.com/document/d/1KtH5atZQUs9Achbce6LiOaJxLbksNJenvgvyKLsJrkc/edit#heading=h.ioikt02qpy5f). Depends on: - [Implement ability for extensions to be notified about effective configuration opentelemetry-collector#6596](open-telemetry/opentelemetry-collector#6596) - [Make service.instance.id and other telemetry attributes available to extensions opentelemetry-collector#6599](open-telemetry/opentelemetry-collector#6599) Closes open-telemetry#16618 --------- Signed-off-by: Sean Porter <[email protected]> Co-authored-by: Daniel Jaglowski <[email protected]> Co-authored-by: Tigran Najaryan <[email protected]>
Do not export function WithTracesMarshalers, WithMetricsMarshalers, WithLogsMarshalers and pass checkapi open-telemetry#26304 **Testing:** go run cmd/checkapi/main.go . make chlog-validate go test for kafkaexporter Co-authored-by: Alex Boten <[email protected]>
…r readme (open-telemetry#28643) The `compression` metric option appears more than once in the readme for the googlecloudexporter exporter, so I've deleted one of the copies. The first copy has more detail, so I preserved that one.
…emeritus (open-telemetry#28645) Removed myself as code owner for bearertokenauth and added myself as emeritus cc: @jpkrohling @frzifus @atoulme atoulme
…tely (open-telemetry#28650) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> When decoding from Azure Resource Log format to OTel if a numeric field is represented without quotes the data will not be decoded and will fail silently. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#28648 **Testing:** <Describe what testing was performed and which tests were added.> Invalid data captured from Azure Diagnostic Setting and used to create a unit test. Then data was reprocessed with the Event Hubs Receiver. **Documentation:** <Describe the documentation added.> None required as this was a bug within the code.
…pen-telemetry#27898) The current behavior consists in exiting early on the first difference found. This approach continues to look at all changes, and only exits after outputting a git diff of all the changes.
892ed4f
to
7965808
Compare
…open-telemetry#29343) **Description:** Part 3 of open-telemetry#28679 these tests needed some fixes, related to file paths, to be re-enabled on Windows. **Link to tracking Issue:** Related to open-telemetry#28679 **Testing:** Local test run on Windows for the affected packages. **Documentation:** N/A
…pen-telemetry#29337) **Description:** Reduce logs relating to the start and finish of processing of metrics to debug level. These logs are very noisy and I don't believe they belong at the info level. They provide contextual information that I believe is more suited to `debug` verbosity.
**Description:** fixing open-telemetry#27045. Fixing datadog receiver to listen to api/v0.2/traces api. **Link to tracking Issue:** open-telemetry#27045 **Testing:** add a a UT to datadog translator for api/v0.2/traces This translator relies on the receiver of datadog agent: https://github.com/DataDog/datadog-agent/blob/2973404818f6cf02138a5ae3ac9019c342adce38/test/integration/serverless/recorder-extension/main.go#L257 E2E tests has been done, where datadog receiver gets traces from the datadog agent.
…ry#28665) **Description:** Update readme with instructions on how to use pprof **Link to tracking Issue:** open-telemetry#26095 **Testing:** Not applicable since no functional code was changed. **Documentation:** The extension readme now contains information what a profile is, how it can be generated and analysed. Co-authored-by: Tyler Helmuth <[email protected]>
**Description:** Fixes a flake issue where one collector subprocess isn't torn down before the next test run: ``` 2023-11-20T19:30:42.822Z error [email protected]/collector.go:255 Asynchronous error received, terminating process {"error": "listen tcp :8888: bind: address already in use"} ``` **Testing:** Adds asserted case cleanup. **Documentation:** none needed
First attempt at custom groups for go deps Signed-off-by: Alex Boten <[email protected]>
…telemetry#29402) [![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/sijms/go-ora/v2](https://togithub.com/sijms/go-ora) | require | patch | `v2.7.20` -> `v2.7.22` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>sijms/go-ora (github.com/sijms/go-ora/v2)</summary> ### [`v2.7.22`](https://togithub.com/sijms/go-ora/releases/tag/v2.7.22): : fix reading summary object from oracle server 10.2 + fix named parameter inside select [Compare Source](https://togithub.com/sijms/go-ora/compare/v2.7.21...v2.7.22) ### [`v2.7.21`](https://togithub.com/sijms/go-ora/releases/tag/v2.7.21): : update column/parameter info with new fields [Compare Source](https://togithub.com/sijms/go-ora/compare/v2.7.20...v2.7.21) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]>
Since the removal of the jaeger exporter, the TestTrace10kSPS/JaegerGRPC has been failing. This was caused by the testbed expecting to be able to export data using the jaeger exporter. This changes the test to use OTLP and adds a new scenario method that supports specifying a different backend for this type of use-case. Fixes open-telemetry#29310 Signed-off-by: Alex Boten <[email protected]>
Creating additional groups based on the result of the previous grouping PR: ![Screenshot 2023-11-20 at 12 32 52 PM](https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/223565/65e96f36-a2d6-48de-b891-c9d5896bbf92) Signed-off-by: Alex Boten <[email protected]>
…open-telemetry#29091) **Description:** Allow running OTTL `convert_sum_to_gauge` and `convert_gauge_to_sum` in metric context instead of datapoint when `processor.transform.ConvertBetweenSumAndGaugeMetricContext` is enabled closes open-telemetry#20773 <!-- **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> --> This is the result of an effort at contribfest at Kubecon NA '23. --------- Signed-off-by: Alex Boten <[email protected]> Co-authored-by: Faith Chikwekwe <[email protected]> Co-authored-by: Tyler Helmuth <[email protected]> Co-authored-by: Andreas Thaler <[email protected]> Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Etienne Pelletier <[email protected]> Co-authored-by: bryan-aguilar <[email protected]> Co-authored-by: Rajkumar Rangaraj <[email protected]> Co-authored-by: Curtis Robert <[email protected]> Co-authored-by: Alex Boten <[email protected]> Co-authored-by: Jacob Marble <[email protected]> Co-authored-by: Jon <[email protected]> Co-authored-by: Daniel Jaglowski <[email protected]> Co-authored-by: Antoine Toulme <[email protected]>
…elemetry#29414) [![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-go) | require | minor | `v1.20.0` -> `v1.21.0` | | [github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-go) | require | minor | `v0.44.1-0.20231113185509-337c81d87781` -> `v0.45.0` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>GoogleCloudPlatform/opentelemetry-operations-go (github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector)</summary> ### [`v0.45.0`](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-go/compare/v0.44.0...v0.45.0) [Compare Source](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-go/compare/v0.44.0...v0.45.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]>
…lemetry#29418) [![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/facebook/time](https://togithub.com/facebook/time) | require | digest | `f7a0d77` -> `620e14e` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]>
…en-telemetry#29419) [![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/cenkalti/backoff/v4](https://togithub.com/cenkalti/backoff) | require | patch | `v4.2.0` -> `v4.2.1` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>cenkalti/backoff (github.com/cenkalti/backoff/v4)</summary> ### [`v4.2.1`](https://togithub.com/cenkalti/backoff/compare/v4.2.0...v4.2.1) [Compare Source](https://togithub.com/cenkalti/backoff/compare/v4.2.0...v4.2.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]>
…pen-telemetry#29416) [![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/docker/go-connections](https://togithub.com/docker/go-connections) | require | digest | `58542c7` -> `fa09c95` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]>
7965808
to
51be5d3
Compare
Description:
Link to tracking Issue:
Testing:
Documentation: