Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Minor changes to Stackdriver example #289

Merged
merged 11 commits into from
Jan 18, 2019
Merged

Minor changes to Stackdriver example #289

merged 11 commits into from
Jan 18, 2019

Conversation

DazWilkin
Copy link
Contributor

@DazWilkin DazWilkin commented Jan 16, 2019

Stackdriver example

Two changes (one needs to be fixed):

-- tagKeys used when creating the view ought match those used when recording stats. The code now creates tagKeys of ["method", "status"];

-- views should be created and then registered but this appears to not be required with this implementation. The code now creates the views without assigning these to unused constants. If the library is amended to require the createView(X) followed by registeredView(X), then these constants may be reverted. Or the result createView may be applied directly to stats.registerView(stats.createView(...).

Prometheus example

Added: mirrors the Stackdriver example. Works but there's likely room for improvement as it is not dependent on the 60-second timeout etc.

README

Added a REAMDE for the examples because there should be one ;-)

It remains unclear to me how to run these examples after cloning. I had to:

  • create a local package.json to spec the @opencensus dependencies but assume there's a better way to do this.
  • specify an absolute path to ./test.txt to get this to work.

Please add an explanation to the README on how to run the examples directly from a clone.


You can observe the Prometheus Metrics Exporter that is created by the sample:
```
http://localhost:9465/metrics
Copy link
Member

Choose a reason for hiding this comment

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

s/9465/9464, we have mentioned 9464 port in example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: 35b7f1e

* metrics that must be collected, or some risk being lost if they are recorded
* after the last export.
*/
setTimeout(function() {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should remove this block. This is not applicable for Prometheus exporter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: 643941c


### Run it

```
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should install cmd here?

npm install @opencensus/core
npm install @opencensus/exporter-stackdriver

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by adding a general package.json and instructions: 713b4d2

Added Dockerfiles and instructions too.

@mayurkale22
Copy link
Member

mayurkale22 commented Jan 17, 2019

@DazWilkin thanks for the PR. Somehow build is failing since last 2 days on node6.

Update: Build failure is not related to this PR. Feel free to merge.

"access": "public"
},
"devDependencies": {
"jshint": "^2.9.7"
Copy link
Member

Choose a reason for hiding this comment

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

Can we use gts here? This is what we use everywhere..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: 42f43e1

@mayurkale22 mayurkale22 merged commit 2f5d8be into census-instrumentation:master Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants