[CSM] fix ingest data retry order messed up#78163
Merged
shahzad31 merged 1 commit intoelastic:masterfrom Sep 23, 2020
Merged
Conversation
Contributor
|
Pinging @elastic/apm-ui (Team:apm) |
Contributor
💚 Build SucceededBuild metrics
To update your PR or re-run it, just comment with: |
ogupte
reviewed
Sep 22, 2020
| item.body = item.body.replace( | ||
| '"name":"client"', | ||
| '"name":"opbean-client-rum"' | ||
| ); |
Contributor
There was a problem hiding this comment.
How risky is it to do a string replace? We might want to manipulate the body as an object rather than a string.
ogupte
approved these changes
Sep 22, 2020
dgieselaar
reviewed
Sep 22, 2020
Comment on lines
+73
to
+94
| function setItemMetaAndHeaders(item) { | ||
| const headers = { | ||
| 'content-type': 'application/x-ndjson', | ||
| }; | ||
|
|
||
| if (SECRET_TOKEN) { | ||
| headers.Authorization = `Bearer ${SECRET_TOKEN}`; | ||
| } | ||
|
|
||
| if (item.url === '/intake/v2/rum/events') { | ||
| if (iterIndex === userAgents.length) { | ||
| // set some event agent to opbean | ||
| setRumAgent(item); | ||
| iterIndex = 0; | ||
| } | ||
| headers['User-Agent'] = userAgents[iterIndex]; | ||
| headers['X-Forwarded-For'] = userIps[iterIndex]; | ||
| iterIndex++; | ||
| } | ||
| return headers; | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
IMO we ran into this situation because of side-effects. If we can make this (more) functional, i.e. don't mutate item and iterIndex, I feel like this code would be more robust and easier to understand. I think changing insertItem() to something like createRequestFromEvent() would help.
Contributor
Author
There was a problem hiding this comment.
Sure, i will do it as a follow up PR, want to get this in to make sure it's working on other PRs.
gmmorris
added a commit
to gmmorris/kibana
that referenced
this pull request
Sep 23, 2020
* master: (31 commits) skip tests for old pacakge (elastic#78194) [Ingest Pipelines] Add url generator for ingest pipelines app (elastic#77872) [Lens] Rename "telemetry" to "stats" (elastic#78125) [CSM] Url search (elastic#77516) [Drilldowns] Config to disable URL Drilldown (elastic#77887) [Lens] Combined histogram/range aggregation for numbers (elastic#76121) Remove legacy plugins support (elastic#77599) 'Auto' interval must be correctly calculated for natural numbers (elastic#77995) [CSM] fix ingest data retry order messed up (elastic#78163) Add response status helpers (elastic#78006) Bump react-beautiful-dnd (elastic#78028) [Security Solution][Detection Engine] Bubbles up more error messages from ES queries to the UI (elastic#78004) Index pattern - refactor constructor (elastic#77791) Add `xpack.security.sameSiteCookies` to docker allow list (elastic#78192) Remove [key: string]: any; from IIndexPattern (elastic#77968) Remove requirement for manage_index_templates privilege for Index Management (elastic#77377) [Ingest Manager] Agent bulk actions UI (elastic#77690) [Metrics UI] Add inventory view timeline (elastic#77804) Reporting/Docs: Updates for setting to enable CSV Download (elastic#78101) Update to latest rum-react (elastic#78193) ...
shahzad31
added a commit
to shahzad31/kibana
that referenced
this pull request
Sep 24, 2020
shahzad31
added a commit
that referenced
this pull request
Sep 24, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #77645
Some custom headers were set on order of ingest, which ended up changing on retries. This PR fixes that.