Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@opencensus/exporter-stackdriver
Advanced tools
OpenCensus Exporter Stackdriver allows user to send collected traces to Stackdriver
OpenCensus Stackdriver Exporter allows the user to send collected traces with OpenCensus Node.js and stats with OpenCensus Core to Stackdriver Cloud Tracing and Stackdriver Monitoring.
This project is still at an early stage of development. It's subject to change.
Install OpenCensus Stackdriver Exporter with:
npm install @opencensus/nodejs
npm install @opencensus/exporter-stackdriver
To use Stackdriver as your exporter, make sure you have enabled Stackdriver Tracing on Google Cloud Platform. Enable your Application Default Credentials for authentication with:
export GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credential.json
Create and register the exporter on your application and pass your Project ID.
For Javascript:
const tracing = require('@opencensus/nodejs');
const { StackdriverTraceExporter } = require('@opencensus/exporter-stackdriver');
// Add your project id to the Stackdriver options
var exporter = new StackdriverTraceExporter({projectId: "your-project-id"});
tracing.registerExporter(exporter).start();
Similarly for TypeScript:
import * as tracing from '@opencensus/nodejs';
import { StackdriverTraceExporter } from '@opencensus/exporter-stackdriver';
// Add your project id to the Stackdriver options
const exporter = new StackdriverTraceExporter({projectId: "your-project-id"});
Now, register the exporter and start tracing.
tracing.start({'exporter': exporter});
or
tracing.registerExporter(exporter).start();
Viewing your traces:
With the above you should now be able to navigate to the Stackdriver UI at: https://console.cloud.google.com/traces/traces
Install OpenCensus Stackdriver Exporter with:
npm install @opencensus/core
npm install @opencensus/exporter-stackdriver
To use Stackdriver as your exporter, make sure you have enabled Stackdriver Monitoring on Google Cloud Platform. Enable your Application Default Credentials for authentication with:
export GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credential.json
Create and register the exporter on your application.
For Javascript:
const { globalStats } = require('@opencensus/core');
const { StackdriverStatsExporter } = require('@opencensus/exporter-stackdriver');
// Add your project id to the Stackdriver options
const exporter = new StackdriverStatsExporter({ projectId: "your-project-id" });
// Pass the created exporter to Stats
globalStats.registerExporter(exporter);
Similarly for TypeScript:
import { globalStats } from '@opencensus/core';
import { StackdriverStatsExporter } from '@opencensus/exporter-stackdriver';
// Add your project id to the Stackdriver options
const exporter = new StackdriverStatsExporter({ projectId: "your-project-id" });
// Pass the created exporter to Stats
globalStats.registerExporter(exporter);
Viewing your metrics:
With the above you should now be able to navigate to the Stackdriver UI at: https://console.cloud.google.com/monitoring
0.0.9 - 2019-02-12
DoubleGauge
, LongGauge
, DerivedDoubleGauge
, DerivedLongGauge
) APIs.opencensus-resource-util
to auto detect AWS, GCE and Kubernetes(K8S) monitored resource, based on the environment where the application is running.uncompressedSize
and compressedSize
fields to MessageEvent
interface.setStatus
method in the Span.This release has multiple breaking changes. Please test your code accordingly after upgrading.
Logger
interface: level
made optional, silly
removed.new Stats()
has been deprecated on Stats class. The global singleton globalStats
object should be used instead. Also, registerView()
is separated out from createView()
.TagKey
, TagValue
and TagMap
to create the tag keys, tag values.status
field on Span
is no longer a number, use CanonicalCode
instead.MessageEvent
, Link
and SpanKind
, instead of string.const { Stats } = require("@opencensus/core");
const stats = new Stats();
// Counts/groups the lengths of lines read in.
const mLineLengths = stats.createMeasureInt64(
"demo/line_lengths",
MeasureUnit.BYTE,
"The distribution of line lengths"
);
// Create tag keys
const tagKeys = ["method", "status"];
// Create and register the view
stats.createView(
"demo/lines_in",
mLineLengths,
AggregationType.COUNT,
tagKeys,
"The number of lines from standard input"
);
// Records measurements
stats.record({
measure: mLineLengths,
tags,
value: 2
});
// Gets the global stats instance
const { globalStats } = require("@opencensus/core");
// Counts/groups the lengths of lines read in.
const mLineLengths = globalStats.createMeasureInt64(
"demo/line_lengths",
MeasureUnit.BYTE,
"The distribution of line lengths"
);
// Creates the method and status key
const methodKey = {name: "method"};
const statusKey = {name: "status"};
// Creates the view
const view = globalStats.createView(
"demo/lines_in",
mLineLengths,
AggregationType.COUNT,
[methodKey, statusKey],
"The number of lines from standard input"
);
// Registers the view
globalStats.registerView(view);
// Creates tags map -> key/value pair
const tagMap = new TagMap();
tagMap.set(methodKey, {value: 'REPL'});
tagMap.set(statusKey, {value: 'OK'});
// Creates measurements (measure + value)
const measurements = [{
measure: mLineLengths,
value: 2
}];
// Records measurement with tagMap
globalStats.record(measurements, tagMap);
FAQs
OpenCensus Exporter Stackdriver allows user to send collected traces to Stackdriver
The npm package @opencensus/exporter-stackdriver receives a total of 3,271 weekly downloads. As such, @opencensus/exporter-stackdriver popularity was classified as popular.
We found that @opencensus/exporter-stackdriver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.