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

[contrib:redis] marking redis service as CACHE by default #97

Merged
merged 4 commits into from
Apr 5, 2017

Conversation

ufoot
Copy link
Member

@ufoot ufoot commented Mar 28, 2017

No description provided.

@ufoot ufoot added this to the 0.6.1 milestone Mar 28, 2017
@ufoot ufoot self-assigned this Mar 28, 2017
@ufoot ufoot requested a review from galdor March 29, 2017 15:05
@@ -59,7 +59,7 @@ def patch_redis_client
end

def initialize(*args)
pin = Datadog::Pin.new(SERVICE, app: 'redis', app_type: Datadog::Ext::AppTypes::CACHE)
pin = Datadog::Pin.new(SERVICE, app: 'redis', app_type: Datadog::Ext::AppTypes::DB)
Copy link
Contributor

Choose a reason for hiding this comment

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

did we choose when we should use the cache type?

Copy link
Member Author

Choose a reason for hiding this comment

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

This should ultimately be the user to decide about. Redis can act as both, this is just a default value. Most of the "added value" of the patch here is: actually do use the value in the Pin and avoid redis spans being reported as "custom" (which is clearly not the case).

Choose a reason for hiding this comment

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

Our "service type" still lack a real Spec, but for now let's just have it consistent with Python. So here, gtm!

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -60,6 +61,9 @@ def patch_redis_client
def initialize(*args)
pin = Datadog::Pin.new(SERVICE, app: 'redis', app_type: Datadog::Ext::AppTypes::DB)
pin.onto(self)
if pin.tracer && pin.service && pin.app && pin.app_type

Choose a reason for hiding this comment

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

Do you really need to test for pin.app && pin.app_type?

Copy link
Member Author

@ufoot ufoot Apr 5, 2017

Choose a reason for hiding this comment

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

Since the pin is created just before and we explicitly set those, no. Good catch. Side note: tracer and service are very likely defined too, but I'd rather be protective, while empty app and app_type will just yield uninteresting results, nil tracer or service would cause an error.

Fix proved a little more complex than expected, previously, actually,
the service meta were just reported as expected. Basically, one needs
to actively call set_service_info for it to work.
@ufoot ufoot merged commit 98d96ae into master Apr 5, 2017
@palazzem palazzem deleted the christian/redisascache branch April 21, 2017 15:31
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.

3 participants