Skip to content

Commit

Permalink
Dependencies update and 8.0.0-beta.1 release (#85)
Browse files Browse the repository at this point in the history
* bump base64-js, pako, ws, remove proto generated files
* chore: bump bignumber.js
* chore: bring back proto generated code into repo
* chore: bump gulp
* refactor: remove text-encoding
* chore: bump sse.js
* chore: move away from gulp-eslint in favor of regular eslint
* chore: move mocha out of gulp
* chore: limit CI matrix
* chore: simplify version
* chore: replace browserify with webpack
* fix: mark ws as external
* chore: fix changelog
* chore: fix version
* chore: drop node 11
* improv: move to axios from request
* fix: docs
* fix: PR feedback
  • Loading branch information
jtmal-signalfx authored Sep 13, 2022
1 parent 5ff308a commit 48ce058
Show file tree
Hide file tree
Showing 24 changed files with 3,771 additions and 13,360 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@splunk/babel-preset"
]
}
6 changes: 6 additions & 0 deletions .browserlistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Officially we support latest-1 for Chrome, FireFox, Safari, and Edge
# Using the list below though to ensure maximum compatibility at minimal cost

defaults
not IE 11
not IE_Mob 11
176 changes: 0 additions & 176 deletions .eslintrc

This file was deleted.

19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
"extends": "eslint:recommended",
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true,
"mocha": true
},
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-prototype-builtins": ["off"]
}
};
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ jobs:
strategy:
fail-fast: true
matrix:
nodejs: ['8', '10', '12', '14', '16', '18']
nodejs: ['12', '14', '16', '18']
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.nodejs }}
- run: npm ci
- run: npm run genprotobuf
- name: Lint code
run: npm run lint
- name: Test
run: npm run test
run: npm run test:ci
- name: Attempt browser build
run: npm run build:browser
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## 8.0.0-beta.1

- Dropped support for Node.js below `12.10` ([#85](https://github.com/signalfx/signalfx-nodejs/pull/85))
- Significant dependencies updates ([#85](https://github.com/signalfx/signalfx-nodejs/pull/85))
- Replaced browserify with webpack ([#85](https://github.com/signalfx/signalfx-nodejs/pull/85))
- `proxy` configuration field now follows axios's format ([#85](https://github.com/signalfx/signalfx-nodejs/pull/85))

## 7.4.2

- Stop existing livetail session before creating new one
Expand Down
18 changes: 18 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Migrating between versions

## 8.0.0 from 7.x

If you are using the `proxy` field of the `options` argument of `new signalfx.Ingest()`:
- the value of `proxy` will be in the format: `http://<USER>:<PASSWORD>@<HOST>:<PORT>`
- it must be restructured into an object as such:
```js
{
protocol: 'http(s)',
host: '<HOST>',
port: PORT,
auth: {
username: '<USER>',
password: '<PASSWORD>'
}
},
```
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ $ npm install signalfx

### Supported Node.js versions

| Version | Node.js |
| ------- | ------------- |
| `7.4.x` | `>=8.0.0 <18` |
| `7.3.1` | `>=8.0.0 <11` |
| Version | Node.js |
| ------- | -------------- |
| `8.x.x` | `>=12.10.0 <18` |
| `7.4.x` | `>=8.0.0 <18` |
| `7.3.1` | `>=8.0.0 <11` |

## Usage

Expand Down Expand Up @@ -64,7 +65,18 @@ Object `options` is an optional map and may contains following fields:
- **timeout** - number, sending datapoints timeout in ms (default is 5000ms)
- **batchSize** - number, batch size to group sending datapoints
- **userAgents** - array of strings, items from this array will be added to 'user-agent' header separated by comma
- **proxy** - string, defines an address and credentials for sending metrics through a proxy server. The string should have the following format `http://<USER>:<PASSWORD>@<HOST>:<PORT>`
- **proxy** - object, defines an address and credentials for sending metrics through a proxy server, it has the following format:
```javascript
{
protocol: 'http(s)',
host: '127.0.0.1',
port: 1234,
auth: {
username: '<username>',
password: '<password>'
}
},
```

#### Configuring the ingest endpoint

Expand Down Expand Up @@ -229,7 +241,7 @@ See `example/general_usage.js` for a complete code example for Reporting data.
Set your SignalFx token and run example
```sh
$ node path/to/example/general_usage.js
$ SPLUNK_ACCESS_TOKEN=xxx SPLUNK_REALM=xxx node example/general_usage.js
```
### Log level
Expand Down
8 changes: 6 additions & 2 deletions example/general_usage.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
'use strict';
var signalFx = require('../lib/signalfx');

var token = 'YOUR SIGNALFX TOKEN'; // Replace with you token
var token = process.env['SPLUNK_ACCESS_TOKEN'];
var realm = process.env['SPLUNK_REALM'] || 'us0';

var client = new signalFx.Ingest(token, {
enableAmazonUniqueId: false, // Set this parameter to `true` to retrieve and add Amazon unique identifier as dimension
dimensions: {type: 'test.cust_dim'} // This dimension will be added to every datapoint and event
ingestEndpoint: 'https://ingest.' + realm + '.signalfx.com',
dimensions: {
type: 'test.cust_dim' // This dimension will be added to every datapoint and event
}
});

// Sent datapoints routine
Expand Down
Loading

0 comments on commit 48ce058

Please sign in to comment.