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

Remove @opencensus/core dep for ocagent exporter #23

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

draffensperger
Copy link
Contributor

I'm planning to make this library buildable with Bazel (see bazelbuild/rules_typescript) and the Closure compiler.

As a prerequisite for that, I'm planning to refactor the way that OpenCensus Web ensures that it implements the @opencensus/core interfaces so that the Bazel build can be cleaner and the Closure optimization can rename a wider group of property names (including those in @opencensus/core). My plan is as follows:

  • Make it so that only @opencensus/web-core depends on @opencensus/core (this PR)
  • Make @opencensus/core have its own copies of the trace type interfaces, but include unit tests to ensure that its Span class also correctly implements the Span interface in @opencensus/core (this can be done by making a derived class that implements the interface)
  • Then add Bazel + Closure build rules

@@ -29,7 +28,7 @@ const RECENT_EPOCH_MS = 1500000000000; // July 13, 2017.
* Converts a RootSpan type from @opencensus/core to the Span JSON structure
Copy link
Member

Choose a reason for hiding this comment

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

Should we change this comment from @opencensus/core -> @opencensus/web-core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done.

Copy link
Member

@mayurkale22 mayurkale22 left a comment

Choose a reason for hiding this comment

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

LGTM, just curious to know the motivation behind making library buildable with Bazel and the Closure compiler.

@draffensperger
Copy link
Contributor Author

The Closure compiler has some more advanced optimization/minification techniques that should result in smaller bundle sizes for use in <script> tags. The Bazel build system allows for incremental builds and is also more similar to Google's internal build system and so would make it easier to use this internally for Google projects as well.

See Angular BuildTools Convergence for more on Bazel for TypeScript.

@draffensperger
Copy link
Contributor Author

The reason I wanted to do this sooner rather than later is that the Closure compiler also restricts certain more dynamic uses of JS due to how it renames properties, so wanted to set up some build rules in CI to make sure future changes would be Closure compiler safe.

@draffensperger draffensperger merged commit 03e637a into master Mar 13, 2019
@draffensperger draffensperger deleted the remove-oc-core-dep-exporter branch March 13, 2019 13:33
RenaultAI pushed a commit to RenaultAI/opencensus-web that referenced this pull request Nov 20, 2019
…fig.yaml

Use the config.yaml file to configure the OpenCensus
interceptor listener's address, instead of using commandline flags.
This is because all the other configurations are performed
using the config.yaml file so an extra option is just confusing.

The default port to run on is 55678 if unspecified, but otherwise
YAML parseable by key `opencensus_interceptor`, and then using the
field name `address`. For example:

```yaml
opencensus_interceptor:
  address: ":55777"
```

and when run with
```shell
ocagent
```

which will then produce:
```shell
2018/10/08 16:36:47 Running OpenCensus interceptor as a gRPC service at "localhost:55777"
```

Fixes census-instrumentation#23
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