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

feat: Add tracing support via minitrace #175

Merged
merged 9 commits into from
Mar 24, 2022
Merged

Conversation

D2Lark
Copy link
Contributor

@D2Lark D2Lark commented Mar 22, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Summary about this PR

refer this issue

I want to confirm this function, minitrace has special macros for asynchronous and synchronous functions to implement span functions sent to jaeger via collector, we just want to track read, write, delete these functions?

Cargo.toml Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@Xuanwo
Copy link
Member

Xuanwo commented Mar 22, 2022

we just want to track read, write, delete these functions?

Yes, I think it's enough, for now, to only track read, write, delete, stat so far.

@D2Lark
Copy link
Contributor Author

D2Lark commented Mar 23, 2022

image
I move the collector to tests/behaviour file, and add macro to s3 accessor .minitrace_jaeger has been move to dev-dependenices. Should I create anaother tests file for tracing?

tests/behavior/behavior.rs Outdated Show resolved Hide resolved
@Xuanwo
Copy link
Member

Xuanwo commented Mar 23, 2022

Should I create anaother tests file for tracing?

We don't need to test the logic of tracing, they are out of the scope of opendal.


BTW, How about adding a new env like OPENDAL_JAEGER_ADDR? We can only set up a collector when we have the OPENDAL_JAEGER_ADDR set.

@Xuanwo Xuanwo changed the title support minitrace feat: Add tracing support via minitrace Mar 23, 2022
@D2Lark
Copy link
Contributor Author

D2Lark commented Mar 24, 2022

I add this to env
# minitrace OPENDAL_JAEGER_TRACE=on OPENDAL_JAEGER_ADDR=127.0.0.1:6831 OPENDAL_JAEGER_SERVICE_NAME=macro_tracing_test

Curious where to load this env variables. Is it in the tests/behavior or in new function like service/s3::new()

@Xuanwo
Copy link
Member

Xuanwo commented Mar 24, 2022

Is it in the tests/behavior or in new function like service/s3::new()

We load env via dotenv: https://github.com/datafuselabs/opendal/blob/6806cb430864475d78a2e64d67facc899150f510/opendal_test/src/services/s3.rs#L31

We will maintian a .env.exmaple as template.

BTW, I think OPENDAL_JAEGER_ADDR is enough, and we don't need to config jaeger service name for testing.

tests/behavior/s3.rs Outdated Show resolved Hide resolved
@Xuanwo
Copy link
Member

Xuanwo commented Mar 24, 2022

Great, let's merge this PR!

@Xuanwo Xuanwo merged commit bbd3152 into apache:main Mar 24, 2022
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.

2 participants