-
Notifications
You must be signed in to change notification settings - Fork 63
Initial commit of the exporter daemon and its Go exporter #1
Conversation
This commit contains an initial prototype for the exporter daemon that can discovered via and endpoint file on the host. The exporter looks for the endpoint file to see the availability of the daemon and exports if it is running. Exporter daemon will allow OpenCensus users to export without having to link a vendor-specific exporter in their final binaries. We are expecting the prototype exporter is going to be implemented in every language and registered by default.
|
||
// Program opencensusd collects OpenCensus stats and traces | ||
// to export to a configured backend. | ||
package main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this repo to "census-instrumentation/opencensusd"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opencensusd will only be one of the binaries/components from the service. We are planning to add more in the future. That's why the repo is named opencensus-service.
} | ||
|
||
func (e *Exporter) init() { | ||
go func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to start a background Goroutine? Why not just check at export time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to check the file and the changes at every time there is export. There are numerous number of exports happening at any time and we don't want to be too aggressively looking up for the file. Btw, we are lazily starting the goroutine at the export time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the a rate limiter to prevent too much checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of behavior, it is not going to change anything but complicate the implementation.
What's the problem of running a goroutine? It doesn't have any cost. It is not like allocating an actual OS thread or anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know but it will appear in stack dumps etc. In general, I would be surprised if a library starts a background process automatically without any opt-in by the user.
…trumentation#1) This commit contains an initial prototype for the exporter daemon that can discovered via and endpoint file on the host. The exporter looks for the endpoint file to see the availability of the daemon and exports if it is running. Exporter daemon will allow OpenCensus users to export without having to link a vendor-specific exporter in their final binaries. We are expecting the prototype exporter is going to be implemented in every language and registered by default. Updates census-instrumentation/opencensus-specs#72.
This commit contains an initial prototype for the exporter daemon
that can discovered via and endpoint file on the host.
The exporter looks for the endpoint file to see the availability
of the daemon and exports if it is running.
Exporter daemon will allow OpenCensus users to export
without having to link a vendor-specific exporter in their final
binaries. We are expecting the prototype exporter is going to
be implemented in every language and registered by default.