clients/client-application-insights/README.md
AWS SDK for JavaScript ApplicationInsights Client for Node.js, Browser and React Native.
<fullname>Amazon CloudWatch Application Insights</fullname>
<p> Amazon CloudWatch Application Insights is a service that helps you detect common problems with your applications. It enables you to pinpoint the source of issues in your applications (built with technologies such as Microsoft IIS, .NET, and Microsoft SQL Server), by providing key insights into detected problems.</p> <p>After you onboard your application, CloudWatch Application Insights identifies, recommends, and sets up metrics and logs. It continuously analyzes and correlates your metrics and logs for unusual behavior to surface actionable problems with your application. For example, if your application is slow and unresponsive and leading to HTTP 500 errors in your Application Load Balancer (ALB), Application Insights informs you that a memory pressure problem with your SQL Server database is occurring. It bases this analysis on impactful metrics and log errors. </p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-application-insightsyarn add @aws-sdk/client-application-insightspnpm add @aws-sdk/client-application-insightsThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the ApplicationInsightsClient and
the commands you need, for example ListApplicationsCommand:
// ES5 example
const { ApplicationInsightsClient, ListApplicationsCommand } = require("@aws-sdk/client-application-insights");
// ES6+ example
import { ApplicationInsightsClient, ListApplicationsCommand } from "@aws-sdk/client-application-insights";
To send a request:
send operation on the client, providing the command object as input.const client = new ApplicationInsightsClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListApplicationsCommand(params);
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
ApplicationInsights extends ApplicationInsightsClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (ApplicationInsightsClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { ApplicationInsights } from "@aws-sdk/client-application-insights";
const client = new ApplicationInsights({ region: "REGION" });
// async/await.
try {
const data = await client.listApplications(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listApplications(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listApplications(params, (err, data) => {
// process err and data.
});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-application-insights package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> CreateApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateComponent </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLogPattern </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteComponent </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteLogPattern </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeComponent </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeComponentConfiguration </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeComponentConfigurationRecommendation </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLogPattern </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeObservation </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeProblem </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeProblemObservations </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeWorkload </summary>Command API Reference / Input / Output
</details> <details> <summary> ListApplications </summary>Command API Reference / Input / Output
</details> <details> <summary> ListComponents </summary>Command API Reference / Input / Output
</details> <details> <summary> ListConfigurationHistory </summary>Command API Reference / Input / Output
</details> <details> <summary> ListLogPatterns </summary>Command API Reference / Input / Output
</details> <details> <summary> ListLogPatternSets </summary>Command API Reference / Input / Output
</details> <details> <summary> ListProblems </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTagsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> ListWorkloads </summary>Command API Reference / Input / Output
</details> <details> <summary> RemoveWorkload </summary>Command API Reference / Input / Output
</details> <details> <summary> TagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UntagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateApplication </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateComponent </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateComponentConfiguration </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLogPattern </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateProblem </summary> </details> <details> <summary> UpdateWorkload </summary> </details>