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

RUMM-1910 Strip query parameters from span resource #728

Merged
merged 1 commit into from Jan 21, 2022

Conversation

xgouchet
Copy link
Contributor

What and why?

Spans have a limited number of unique resource values. Removing query parameters ensure we don't use too many unique slots, and aligns the iOS SDK with android and other APM implementations.

@xgouchet xgouchet requested a review from a team as a code owner January 19, 2022 13:00
Comment on lines +422 to +427
static func mockWith(url: String, queryParams: [URLQueryItem], httpMethod: String) -> URLRequest {
let url: URL = .mockWith(url: url, queryParams: queryParams)
var request = URLRequest(url: url)
request.httpMethod = httpMethod
return request
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could simplify mocking by getting rid of func mockWith(url: String, queryParams: [URLQueryItem]) -> URL

and do

static func mockWith(url string: String, httpMethod: String = "GET") -> URLRequest {
    let url: URL = URL(string: string)!
    var request = URLRequest(url: url)
    request.httpMethod = httpMethod
    return request
}

let request: URLRequest = .mockWith(url: "https://www.example.com?foo=42&lang=en")

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always more inclined to have more control. Also, assuming we could use some fuzzy testing in iOS, it'd be easier to generate a random base url and a random list of query param to build the full url than writing all like you propose

@xgouchet xgouchet requested a review from maxep January 20, 2022 14:05
@xgouchet xgouchet merged commit 45916d2 into master Jan 21, 2022
@maxep maxep mentioned this pull request Jan 27, 2022
@ncreated ncreated deleted the xgouchet/RUMM-1910/fix_span_resource branch April 12, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants