-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change adds metrics reporting to the tracer. Co-Authored-By: Isobel Redelmeier <[email protected]>
- Loading branch information
1 parent
e23ae13
commit 17fbf59
Showing
17 changed files
with
904 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.19.0 | ||
0.20.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package constants | ||
|
||
const ( | ||
// ComponentNameKey is the tag key identifying the service | ||
ComponentNameKey = "lightstep.component_name" | ||
// HostnameKey is the tag key identifying hostname | ||
HostnameKey = "lightstep.hostname" | ||
// ServiceVersionKey is the tag key identifying service version | ||
ServiceVersionKey = "service.version" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package metrics | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/onsi/ginkgo" | ||
"github.com/onsi/gomega" | ||
) | ||
|
||
var _ = ginkgo.Describe("the reporter", func() { | ||
ginkgo.Describe("configuration", func() { | ||
ginkgo.It("uses default values", func() { | ||
defaultReporter := NewReporter() | ||
gomega.Expect(defaultReporter.tracerID).To(gomega.Equal(uint64(0))) | ||
gomega.Expect(defaultReporter.attributes).To(gomega.Equal(map[string]string{})) | ||
gomega.Expect(defaultReporter.address).To(gomega.Equal(fmt.Sprintf("%s%s", defaultReporterAddress, reporterPath))) | ||
gomega.Expect(defaultReporter.timeout).To(gomega.Equal(defaultReporterTimeout)) | ||
gomega.Expect(defaultReporter.measurementDuration).To(gomega.Equal(defaultReporterMeasurementDuration)) | ||
gomega.Expect(defaultReporter.accessToken).To(gomega.Equal("")) | ||
}) | ||
ginkgo.It("uses configured values", func() { | ||
duration := time.Second * 1 | ||
accessToken := "token-1234" | ||
tracerID := uint64(1234) | ||
attributes := map[string]string{ | ||
"key1": "val1", | ||
"key2": "val2", | ||
} | ||
address := "http://localhost:8080" | ||
defaultReporter := NewReporter( | ||
WithReporterTracerID(tracerID), | ||
WithReporterAttributes(attributes), | ||
WithReporterAddress(address), | ||
WithReporterTimeout(duration), | ||
WithReporterMeasurementDuration(duration), | ||
WithReporterAccessToken(accessToken), | ||
) | ||
gomega.Expect(defaultReporter.tracerID).To(gomega.Equal(tracerID)) | ||
gomega.Expect(defaultReporter.attributes).To(gomega.Equal(attributes)) | ||
gomega.Expect(defaultReporter.address).To(gomega.Equal(fmt.Sprintf("%s%s", address, reporterPath))) | ||
gomega.Expect(defaultReporter.timeout).To(gomega.Equal(duration)) | ||
gomega.Expect(defaultReporter.measurementDuration).To(gomega.Equal(duration)) | ||
gomega.Expect(defaultReporter.accessToken).To(gomega.Equal(accessToken)) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.