-
Notifications
You must be signed in to change notification settings - Fork 55
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
Open Telemetry Transport #1229
base: master
Are you sure you want to change the base?
Open Telemetry Transport #1229
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1229 +/- ##
==========================================
- Coverage 81.72% 81.16% -0.55%
==========================================
Files 176 178 +2
Lines 42965 43308 +343
Branches 4782 4812 +30
==========================================
+ Hits 35109 35149 +40
- Misses 6625 6917 +292
- Partials 1231 1242 +11
|
Cover the code with unit tests and implement an integration test that will use the OTLP endpoint. |
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've made few comments and will continue going through the otlp code.
return True | ||
|
||
# Implement https://datatracker.ietf.org/doc/html/rfc6749#section-4.4 flow | ||
class OAuth2(object): |
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.
Isn't there a python library for OAuth2 to avoid having an in-house implementation?
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.
Python2 requirement paints us into some really weird corners like having to be on older versions of code that opens up security risks. This seems like the path of least resistance. I originally used the OpenTelemetry Python SDK, but had to back out of that because of no Python2 support.
scalyr_agent/configuration.py
Outdated
return self.__get_config().get_string("auth") | ||
|
||
@property | ||
def client_id(self): |
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.
Please move all oauth2 configuration keys under a new oauth2 key:
oauth2:
->> client_id:
->> client_secret:
....
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 went with oauth_
prefix instead which goes with the current pattern used for kubernetes keys (k8s_
)
@@ -354,6 +355,7 @@ def __init__(self, configuration, worker_config_entry, session_id, is_daemon=Fal | |||
|
|||
# The current pending AddEventsTask. We will retry the contained AddEventsRequest several times. | |||
self.__pending_add_events_task = None | |||
self.__receive_response_status = {} |
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.
Where is this private field used?
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.
in self.__pending_add_events_task.__receive_response_status |
Trying to resolve this error (it doesn't):
2024-01-26 17:17:51.891Z ERROR [core] [scalyr_agent.scalyr_logging:707] Failed while attempting to scan and transmit logs :stack_trace:
Traceback (most recent call last):
File "/Users/anthonyj/_Scalyr/scalyr-agent-2/scalyr_agent/copying_manager/worker.py", line 500, in run
"Repeatedly failed to parse response due to exception. Dropping events",
AttributeError: 'AddEventsTask' object has no attribute '_CopyingManagerWorkerSession__receive_response_status'
I defined the attribute in hopes that this was just a sequencing issue in the way the scalyr_client
works, but this didn't fix it. Happens when we start to hit publishing delays. Easiest way for me to hit it is to Debug Agent;Pause Execution for X minutes;Resume Agent
Since this is experimental, I'm comfortable shipping this bug to the customer so they can provide feedback on the feature.
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 meant the second one on the line 358. I believe that's a mistake.
@@ -354,6 +355,7 @@ def __init__(self, configuration, worker_config_entry, session_id, is_daemon=Fal | |||
|
|||
# The current pending AddEventsTask. We will retry the contained AddEventsRequest several times. | |||
self.__pending_add_events_task = None | |||
self.__receive_response_status = {} |
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 meant the second one on the line 358. I believe that's a mistake.
scalyr_agent/otlp_client.py
Outdated
body=PB2AnyValue(string_value=event.message), | ||
attributes=_encode_attributes(event.attrs)) | ||
|
||
def __get_user_agent( |
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.
This whole method is copy pasted from scalyr_client.py.
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.
yes. This was intentional to avoid touching scalyr_client.py
. I went ahead and moved this method and the wrap method to util.py
* CRI split lines support * mixed lines testing * addressing PR comments * Type hinting and comments * Type hinting and comments
…urrent.futures imported only for PY3 (#1230)
GitOrigin-RevId: 822da6158def4cfa5be88cccf8be4ddcbf5c3ab7
Experimental OTLP Transport. Allows output to an Open Telemetry Collector.