How to use the @dynatrace/oneagent-sdk.createInstance function in @dynatrace/oneagent-sdk

To help you get started, we’ve selected a few @dynatrace/oneagent-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Dynatrace / OneAgent-SDK-for-NodeJs / samples / RemoteCall / IncomingRemoteCallSample.js View on Github external
http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

"use strict";

// tslint:disable:no-console

// ----------------------------------------------------------------------------
const Sdk = require("@dynatrace/oneagent-sdk");
const Api = Sdk.createInstance();

// ----------------------------------------------------------------------------
if (Api.getCurrentState() !== Sdk.SDKState.ACTIVE) {
  console.error("IncomingRemoteCallSample: SDK is not active!");
}

// install logging callbacks
Api.setLoggingCallbacks({
  warning: (msg) => console.error("IncomingRemoteCallSample SDK warning: " + msg),
  error: (msg) => console.error("IncomingRemoteCallSample SDK error: " + msg)
});

// ----------------------------------------------------------------------------

// Function actually processing the message
async function processMessage(message) {
github Dynatrace / OneAgent-SDK-for-NodeJs / samples / CustomRequestAttributes / CustomRequestAttributesSample.js View on Github external
http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

"use strict";

// tslint:disable:no-console

// ----------------------------------------------------------------------------
const Sdk = require("@dynatrace/oneagent-sdk");
const Api = Sdk.createInstance();

// ----------------------------------------------------------------------------
if (Api.getCurrentState() !== Sdk.SDKState.ACTIVE) {
  console.error("CustomRequestAttributesSample: SDK is not active!");
}

// install logging callbacks
Api.setLoggingCallbacks({
  warning: (msg) => console.error("CustomRequestAttributesSample SDK warning: " + msg),
  error: (msg) => console.error("CustomRequestAttributesSample SDK error: " + msg)
});

// ----------------------------------------------------------------------------
const http = require("http");

// ----------------------------------------------------------------------------
github Dynatrace / OneAgent-SDK-for-NodeJs / samples / Database / DatabaseRequestSample.js View on Github external
http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

"use strict";

// tslint:disable:no-console

// ----------------------------------------------------------------------------
const Sdk = require("@dynatrace/oneagent-sdk");
const Api = Sdk.createInstance();

// ----------------------------------------------------------------------------
if (Api.getCurrentState() !== Sdk.SDKState.ACTIVE) {
  console.error("DatabaseRequestSample: SDK is not active!");
}

// install logging callbacks
Api.setLoggingCallbacks({
  warning: (msg) => console.error("DatabaseRequestSample SDK warning: " + msg),
  error: (msg) => console.error("DatabaseRequestSample SDK error: " + msg)
});

// ----------------------------------------------------------------------------
const http = require("http");

// ----------------------------------------------------------------------------
github Dynatrace / OneAgent-SDK-for-NodeJs / samples / RemoteCall / OutgoingRemoteCallSample.js View on Github external
http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

"use strict";

// tslint:disable:no-console

// ----------------------------------------------------------------------------
const Sdk = require("@dynatrace/oneagent-sdk");
const Api = Sdk.createInstance();

// ----------------------------------------------------------------------------
if (Api.getCurrentState() !== Sdk.SDKState.ACTIVE) {
  console.error("OutgoingRemoteCallSample: SDK is not active!");
}

// install logging callbacks
Api.setLoggingCallbacks({
  warning: (msg) => console.error("OutgoingRemoteCallSample SDK warning: " + msg),
  error: (msg) => console.error("OutgoingRemoteCallSample SDK error: " + msg)
});

// ----------------------------------------------------------------------------
const cp = require("child_process");

let id = 0;

@dynatrace/oneagent-sdk

Node.js SDK for Dynatrace OneAgent

Apache-2.0
Latest version published 2 years ago

Package Health Score

55 / 100
Full package analysis