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

[mongodb] add Rails example with Mongoid #28

Merged
merged 1 commit into from
Aug 14, 2017

Conversation

palazzem
Copy link
Contributor

Overview

Adds a Mongoid example used from a Rails 4.x application. The MongoDB Ruby Driver is instrumented using the latest available branch.


# branch with MongoDB Ruby Driver instrumentation
gem 'ddtrace', :git => 'https://github.com/DataDog/dd-trace-rb.git', :ref => '23903b15fb3297a08662fbbd28647561dd5d66a8'
gem 'mongoid', '5.1.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the latest available branch that must be changed when shipping a new version. Mongoid is kept to an older version to test the compatibility.

# Mongoid instrumentation with a custom service name
Datadog::Monkey.patch_module(:mongo)
pin = Datadog::Pin.get_from(Mongoid::Clients.default)
pin.service = 'example-mongodb'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing more is needed to instrument Mongoid / MongoDB Ruby driver

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ufoot ufoot merged commit b6fbfd1 into master Aug 14, 2017
@palazzem palazzem deleted the palazzem/mongoid-standalone branch August 28, 2017 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants