Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Initial commit of the exporter daemon and its Go exporter #1

Merged
merged 1 commit into from
Jun 7, 2018

Conversation

rakyll
Copy link
Contributor

@rakyll rakyll commented Jun 6, 2018

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.

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

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"?

Copy link
Contributor Author

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() {

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?

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 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.

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.

Copy link
Contributor Author

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.

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.

@rakyll rakyll merged commit e3604d9 into census-instrumentation:master Jun 7, 2018
@rakyll rakyll deleted the initial2 branch June 7, 2018 22:42
fivesheep pushed a commit to fivesheep/opencensus-service that referenced this pull request Jun 12, 2019
…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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants