@backstage-community/plugin-dynatrace 10.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # Dynatrace
2
+
3
+ Welcome to the Dynatrace plugin!
4
+
5
+ ![Example of the Dynatrace plugin](./assets/plugin.png)
6
+
7
+ ## Getting started
8
+
9
+ This plugin uses the Backstage proxy to communicate with Dynatrace's REST APIs.
10
+
11
+ ### Setup
12
+
13
+ #### Requirements
14
+
15
+ ##### Dynatrace API Key
16
+
17
+ The Dynatrace plugin will require the following information, to be used in the configuration options detailed below:
18
+
19
+ - Dynatrace API URL, e.g. `https://my-dynatrace-instance.dynatrace.com/api/v2`
20
+ - Dynatrace API access token (see [documentation](https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication)), with the following permissions:
21
+ - `entities.read`
22
+ - `problems.read`
23
+ - `DataExport` and/or `ExternalSyntheticIntegration` and/or `ReadSyntheticData`
24
+
25
+ #### Install
26
+
27
+ 1. Install the plugin on your frontend:
28
+
29
+ ```
30
+ # From your Backstage root directory
31
+ yarn --cwd packages/app add @backstage-community/plugin-dynatrace
32
+ ```
33
+
34
+ 2. We created in our catalog the interface for using the integration with Dynatrace.
35
+
36
+ ```diff
37
+ # packages/app/src/components/catalog/EntityPage.tsx
38
+
39
+ [...]
40
+ + import { DynatraceTab, isDynatraceAvailable } from '@backstage-community/plugin-dynatrace'
41
+
42
+ [...]
43
+
44
+ const serviceEntityPage = (
45
+ <EntityLayout>
46
+ [...]
47
+ + <EntityLayout.Route
48
+ + path="/dynatrace"
49
+ + title="Dynatrace"
50
+ + if={isDynatraceAvailable}
51
+ + >
52
+ + <DynatraceTab />
53
+ + </EntityLayout.Route>
54
+ </EntityLayout>
55
+ )
56
+
57
+ ```
58
+
59
+ #### Plugin Configuration
60
+
61
+ This plugin requires a proxy endpoint for Dynatrace configured in `app-config.yaml` like so:
62
+
63
+ ```yaml
64
+ proxy:
65
+ endpoints:
66
+ '/dynatrace':
67
+ target: 'https://example.dynatrace.com/api/v2'
68
+ headers:
69
+ Authorization: 'Api-Token ${DYNATRACE_ACCESS_TOKEN}'
70
+ ```
71
+
72
+ It also requires a `baseUrl` for rendering links to problems in the table like so:
73
+
74
+ ```yaml
75
+ dynatrace:
76
+ baseUrl: 'https://example.dynatrace.com'
77
+ ```
78
+
79
+ #### Catalog Configuration
80
+
81
+ ##### View Recent Application Problems
82
+
83
+ To show information from Dynatrace for a catalog entity, add the following annotation to `catalog-info.yaml`:
84
+
85
+ ```yaml
86
+ # catalog-info.yaml
87
+ # [...]
88
+ metadata:
89
+ annotations:
90
+ dynatrace.com/dynatrace-entity-id: DYNATRACE_ENTITY_ID
91
+ # [...]
92
+ ```
93
+
94
+ The `DYNATRACE_ENTITY_ID` can be found in Dynatrace by browsing to the entity (a service, synthetic, frontend, workload, etc.). It will be located in the browser address bar in the `id` parameter and has the format `ENTITY_TYPE-ENTITY_ID`, where `ENTITY_TYPE` will be one of `SERVICE`, `SYNTHETIC_TEST`, or other, and `ENTITY_ID` will be a string of characters containing uppercase letters and numbers.
95
+
96
+ ##### Viewing Recent Synthetics Results
97
+
98
+ To show recent results from a Synthetic Monitor, add the following annotation to `catalog-info.yaml`:
99
+
100
+ ```yaml
101
+ # catalog-info.yaml
102
+ # [...]
103
+ metadata:
104
+ annotations:
105
+ dynatrace.com/synthetics-ids: SYNTHETIC_ID, SYNTHETIC_ID_2, ...
106
+ # [...]
107
+ ```
108
+
109
+ The annotation can also contain a comma or space separated list of Synthetic Ids to surface details for multiple monitors!
110
+
111
+ The `SYNTHETIC_ID` can be found in Dynatrace by browsing to the Synthetic monitor. It will be located in the browser address bar in the resource path - `https://example.dynatrace.com/ui/http-monitor/HTTP_CHECK-1234` for an Http check, or `https://example.dynatrace.com/ui/browser-monitor/SYNTHETIC_TEST-1234` for a browser clickpath.
112
+
113
+ ## Contribution
114
+
115
+ This plugin was originally built by [TELUS](https://github.com/telus).
116
+
117
+ ## Disclaimer
118
+
119
+ This plugin is not officially supported by Dynatrace.
package/config.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright 2022 The Backstage Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export interface Config {
17
+ /**
18
+ * dynatrace config
19
+ * @visibility frontend
20
+ */
21
+ dynatrace?: {
22
+ /**
23
+ * base url for links
24
+ * @visibility frontend
25
+ */
26
+ baseUrl: string;
27
+ };
28
+ }
@@ -0,0 +1,252 @@
1
+ import React from 'react';
2
+ import Grid from '@material-ui/core/Grid';
3
+ import { StatusOK, StatusError, Table, Link, Progress, ResponseErrorPanel, InfoCard, EmptyState, Page, Content } from '@backstage/core-components';
4
+ import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
5
+ import useAsync from 'react-use/esm/useAsync';
6
+ import { useApi, configApiRef } from '@backstage/core-plugin-api';
7
+ import { d as dynatraceApiRef, i as isDynatraceAvailable, D as DYNATRACE_ID_ANNOTATION, a as DYNATRACE_SYNTHETICS_ANNOTATION } from './index-DHDulpiV.esm.js';
8
+ import Chip from '@material-ui/core/Chip';
9
+
10
+ const ProblemStatus = ({ status }) => {
11
+ switch (status == null ? void 0 : status.toLocaleLowerCase()) {
12
+ case "open":
13
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(StatusError, null), "Open");
14
+ case "closed":
15
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(StatusOK, null), "Closed");
16
+ default:
17
+ return /* @__PURE__ */ React.createElement(React.Fragment, null);
18
+ }
19
+ };
20
+
21
+ const parseTimestamp = (timestamp) => {
22
+ return timestamp ? new Date(timestamp).toLocaleString() : "N/A";
23
+ };
24
+ const ProblemsTable = (props) => {
25
+ const { problems, dynatraceBaseUrl } = props;
26
+ const columns = [
27
+ {
28
+ title: "Title",
29
+ field: "title",
30
+ render: (row) => /* @__PURE__ */ React.createElement(
31
+ Link,
32
+ {
33
+ to: `${dynatraceBaseUrl}/#problems/problemdetails;pid=${row.problemId}`
34
+ },
35
+ row.title
36
+ )
37
+ },
38
+ {
39
+ title: "Status",
40
+ field: "status",
41
+ render: (row) => /* @__PURE__ */ React.createElement(ProblemStatus, { status: row.status })
42
+ },
43
+ { title: "Severity", field: "severityLevel" },
44
+ {
45
+ title: "Root Cause",
46
+ field: "rootCauseEntity",
47
+ render: (row) => {
48
+ var _a;
49
+ return (_a = row.rootCauseEntity) == null ? void 0 : _a.name;
50
+ }
51
+ },
52
+ {
53
+ title: "Affected",
54
+ field: "affectedEntities",
55
+ render: (row) => {
56
+ var _a;
57
+ return (_a = row.affectedEntities) == null ? void 0 : _a.map((e) => e.name);
58
+ }
59
+ },
60
+ {
61
+ title: "Start Time",
62
+ field: "startTime",
63
+ render: (row) => parseTimestamp(row.startTime)
64
+ },
65
+ {
66
+ title: "End Time",
67
+ field: "endTime",
68
+ render: (row) => row.endTime === -1 ? "ongoing" : parseTimestamp(row.endTime)
69
+ }
70
+ ];
71
+ return /* @__PURE__ */ React.createElement(
72
+ Table,
73
+ {
74
+ options: { search: true, paging: true },
75
+ columns,
76
+ data: problems.map((p) => {
77
+ return { ...p, id: p.problemId };
78
+ })
79
+ }
80
+ );
81
+ };
82
+
83
+ const cardContents = (problems, dynatraceBaseUrl) => {
84
+ return problems.length ? /* @__PURE__ */ React.createElement(
85
+ ProblemsTable,
86
+ {
87
+ problems: problems || [],
88
+ dynatraceBaseUrl
89
+ }
90
+ ) : /* @__PURE__ */ React.createElement(EmptyState, { title: "No Problems to Report!", missing: "data" });
91
+ };
92
+ const dynatraceEntityPrefixes = (idPrefix) => {
93
+ switch (idPrefix) {
94
+ case "APPLICATION":
95
+ return "#uemapplications/uemappmetrics;uemapplicationId=";
96
+ case "SERVICE":
97
+ return "#services/serviceOverview;id=";
98
+ case `MOBILE_APPLICATION`:
99
+ return "#mobileappoverview;appID=";
100
+ case "SYNTHETIC_TEST":
101
+ return "ui/browser-monitor/";
102
+ case "KUBERNETES_CLUSTER":
103
+ return "ui/kubernetes/";
104
+ case "PROCESS_GROUP_INSTANCE":
105
+ return "#processdetails;id=";
106
+ default:
107
+ return "ui/entity/";
108
+ }
109
+ };
110
+ const ProblemsList = (props) => {
111
+ const { dynatraceEntityId } = props;
112
+ const configApi = useApi(configApiRef);
113
+ const dynatraceApi = useApi(dynatraceApiRef);
114
+ const dynatraceBaseUrl = configApi.getString("dynatrace.baseUrl");
115
+ const { value, loading, error } = useAsync(async () => {
116
+ return dynatraceApi.getDynatraceProblems(dynatraceEntityId);
117
+ }, [dynatraceApi, dynatraceEntityId]);
118
+ const problems = value == null ? void 0 : value.problems;
119
+ const deepLinkPrefix = dynatraceEntityPrefixes(
120
+ `${dynatraceEntityId.split("-")[0]}`
121
+ );
122
+ if (loading) {
123
+ return /* @__PURE__ */ React.createElement(Progress, null);
124
+ } else if (error) {
125
+ return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
126
+ }
127
+ return /* @__PURE__ */ React.createElement(
128
+ InfoCard,
129
+ {
130
+ title: "Problems",
131
+ subheader: `Last 2 hours - ${dynatraceEntityId}`,
132
+ deepLink: {
133
+ title: "View Entity in Dynatrace",
134
+ link: `${dynatraceBaseUrl}/${deepLinkPrefix}${dynatraceEntityId}`
135
+ }
136
+ },
137
+ cardContents(problems || [], dynatraceBaseUrl)
138
+ );
139
+ };
140
+
141
+ const failedInLastXHours = (timestamp, offset) => {
142
+ if (offset < 0 || offset > 24)
143
+ throw new Error("offset must be between 0 and 24");
144
+ return timestamp > new Date((/* @__PURE__ */ new Date()).getTime() - 1e3 * 60 * 60 * offset);
145
+ };
146
+ const chipColor = (timestamp) => {
147
+ if (failedInLastXHours(timestamp, 1)) {
148
+ return "salmon";
149
+ }
150
+ if (failedInLastXHours(timestamp, 6)) {
151
+ return "sandybrown";
152
+ }
153
+ if (failedInLastXHours(timestamp, 24)) {
154
+ return "palegoldenrod";
155
+ }
156
+ return "lightgreen";
157
+ };
158
+ const SyntheticsLocation = (props) => {
159
+ const { lastFailedTimestamp, locationId } = props;
160
+ const dynatraceApi = useApi(dynatraceApiRef);
161
+ const { value, loading, error } = useAsync(async () => {
162
+ return dynatraceApi.getDynatraceSyntheticLocationInfo(
163
+ `SYNTHETIC_LOCATION-00000000000000${locationId}`
164
+ );
165
+ });
166
+ if (loading) {
167
+ return /* @__PURE__ */ React.createElement(Progress, null);
168
+ } else if (error) {
169
+ return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
170
+ }
171
+ return /* @__PURE__ */ React.createElement(
172
+ Chip,
173
+ {
174
+ label: `${value == null ? void 0 : value.name}${failedInLastXHours(new Date(lastFailedTimestamp), 24) ? `: failed @ ${lastFailedTimestamp.toLocaleTimeString()}` : ""}`,
175
+ size: "medium",
176
+ style: { backgroundColor: chipColor(lastFailedTimestamp) }
177
+ }
178
+ );
179
+ };
180
+
181
+ const dynatraceMonitorPrefixes = (idPrefix) => {
182
+ switch (idPrefix) {
183
+ case "HTTP_CHECK":
184
+ return "ui/http-monitor";
185
+ case "BROWSER_MONITOR":
186
+ return "ui/browser-monitor";
187
+ case "SYNTHETIC_TEST":
188
+ return "ui/browser-monitor";
189
+ default:
190
+ throw new Error("Invalid synthetic Id");
191
+ }
192
+ };
193
+ const SyntheticsCard = (props) => {
194
+ const { syntheticsId } = props;
195
+ const configApi = useApi(configApiRef);
196
+ const dynatraceApi = useApi(dynatraceApiRef);
197
+ const dynatraceBaseUrl = configApi.getString("dynatrace.baseUrl");
198
+ const { value, loading, error } = useAsync(async () => {
199
+ return dynatraceApi.getDynatraceSyntheticFailures(syntheticsId);
200
+ }, [dynatraceApi, syntheticsId]);
201
+ if (loading) {
202
+ return /* @__PURE__ */ React.createElement(Progress, null);
203
+ } else if (error) {
204
+ return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
205
+ }
206
+ const deepLinkPrefix = dynatraceMonitorPrefixes(
207
+ `${syntheticsId.split("-")[0]}`
208
+ );
209
+ const lastFailed = value == null ? void 0 : value.locationsExecutionResults.map((l) => {
210
+ return {
211
+ timestamp: l.requestResults[0].startTimestamp,
212
+ location: Number(l.locationId).toString(16)
213
+ };
214
+ });
215
+ return /* @__PURE__ */ React.createElement(
216
+ InfoCard,
217
+ {
218
+ title: "Synthetics",
219
+ subheader: `Recent Activity for Monitor ${syntheticsId}`,
220
+ deepLink: {
221
+ title: "View this Synthetic in Dynatrace",
222
+ link: `${dynatraceBaseUrl}/${deepLinkPrefix}/${syntheticsId}`
223
+ }
224
+ },
225
+ lastFailed == null ? void 0 : lastFailed.map((l) => {
226
+ return /* @__PURE__ */ React.createElement(
227
+ SyntheticsLocation,
228
+ {
229
+ key: l.location,
230
+ lastFailedTimestamp: new Date(l.timestamp),
231
+ locationId: l.location
232
+ }
233
+ );
234
+ })
235
+ );
236
+ };
237
+
238
+ const DynatraceTab = () => {
239
+ var _a, _b;
240
+ const { entity } = useEntity();
241
+ if (!isDynatraceAvailable(entity)) {
242
+ return /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { annotation: DYNATRACE_ID_ANNOTATION });
243
+ }
244
+ const dynatraceEntityId = (_a = entity == null ? void 0 : entity.metadata.annotations) == null ? void 0 : _a[DYNATRACE_ID_ANNOTATION];
245
+ const syntheticsIds = (_b = entity == null ? void 0 : entity.metadata.annotations) == null ? void 0 : _b[DYNATRACE_SYNTHETICS_ANNOTATION];
246
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, dynatraceEntityId ? /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, lg: 12 }, /* @__PURE__ */ React.createElement(ProblemsList, { dynatraceEntityId })) : "", syntheticsIds == null ? void 0 : syntheticsIds.split(/[ ,]/).filter(Boolean).map((id) => {
247
+ return /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, lg: 12 }, /* @__PURE__ */ React.createElement(SyntheticsCard, { syntheticsId: id }));
248
+ }))));
249
+ };
250
+
251
+ export { DynatraceTab };
252
+ //# sourceMappingURL=index-CHd0IpuU.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CHd0IpuU.esm.js","sources":["../../src/components/Problems/ProblemStatus/ProblemStatus.tsx","../../src/components/Problems/ProblemsTable/ProblemsTable.tsx","../../src/components/Problems/ProblemsList/ProblemsList.tsx","../../src/components/Synthetics/SyntheticsLocation/SyntheticsLocation.tsx","../../src/components/Synthetics/SyntheticsCard/SyntheticsCard.tsx","../../src/components/DynatraceTab/DynatraceTab.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { DynatraceProblem } from '../../../api/DynatraceApi';\nimport { StatusError, StatusOK } from '@backstage/core-components';\n\nexport const ProblemStatus = ({ status }: Partial<DynatraceProblem>) => {\n switch (status?.toLocaleLowerCase()) {\n case 'open':\n return (\n <>\n <StatusError />\n Open\n </>\n );\n case 'closed':\n return (\n <>\n <StatusOK />\n Closed\n </>\n );\n default:\n return <></>;\n }\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { DynatraceProblem } from '../../../api/DynatraceApi';\nimport { ProblemStatus } from '../ProblemStatus';\nimport { Link } from '@backstage/core-components';\n\ntype ProblemsTableProps = {\n problems: DynatraceProblem[];\n dynatraceBaseUrl: string;\n};\n\nconst parseTimestamp = (timestamp: number | undefined) => {\n return timestamp ? new Date(timestamp).toLocaleString() : 'N/A';\n};\n\nexport const ProblemsTable = (props: ProblemsTableProps) => {\n const { problems, dynatraceBaseUrl } = props;\n const columns: TableColumn[] = [\n {\n title: 'Title',\n field: 'title',\n render: (row: Partial<DynatraceProblem>) => (\n <Link\n to={`${dynatraceBaseUrl}/#problems/problemdetails;pid=${row.problemId}`}\n >\n {row.title}\n </Link>\n ),\n },\n {\n title: 'Status',\n field: 'status',\n render: (row: Partial<DynatraceProblem>) => (\n <ProblemStatus status={row.status} />\n ),\n },\n { title: 'Severity', field: 'severityLevel' },\n {\n title: 'Root Cause',\n field: 'rootCauseEntity',\n render: (row: Partial<DynatraceProblem>) => row.rootCauseEntity?.name,\n },\n {\n title: 'Affected',\n field: 'affectedEntities',\n render: (row: Partial<DynatraceProblem>) =>\n row.affectedEntities?.map(e => e.name),\n },\n {\n title: 'Start Time',\n field: 'startTime',\n render: (row: Partial<DynatraceProblem>) => parseTimestamp(row.startTime),\n },\n {\n title: 'End Time',\n field: 'endTime',\n render: (row: Partial<DynatraceProblem>) =>\n row.endTime === -1 ? 'ongoing' : parseTimestamp(row.endTime),\n },\n ];\n\n return (\n <Table\n options={{ search: true, paging: true }}\n columns={columns}\n data={problems.map(p => {\n return { ...p, id: p.problemId };\n })}\n />\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n Progress,\n ResponseErrorPanel,\n EmptyState,\n} from '@backstage/core-components';\nimport { useApi, configApiRef } from '@backstage/core-plugin-api';\nimport { ProblemsTable } from '../ProblemsTable';\nimport { dynatraceApiRef, DynatraceProblem } from '../../../api';\nimport { InfoCard } from '@backstage/core-components';\n\ntype ProblemsListProps = {\n dynatraceEntityId: string;\n};\n\nconst cardContents = (\n problems: DynatraceProblem[],\n dynatraceBaseUrl: string,\n) => {\n return problems.length ? (\n <ProblemsTable\n problems={problems || []}\n dynatraceBaseUrl={dynatraceBaseUrl}\n />\n ) : (\n <EmptyState title=\"No Problems to Report!\" missing=\"data\" />\n );\n};\n\nconst dynatraceEntityPrefixes = (idPrefix: string): string => {\n switch (idPrefix) {\n case 'APPLICATION':\n return '#uemapplications/uemappmetrics;uemapplicationId=';\n\n case 'SERVICE':\n return '#services/serviceOverview;id=';\n\n case `MOBILE_APPLICATION`:\n return '#mobileappoverview;appID=';\n\n case 'SYNTHETIC_TEST':\n return 'ui/browser-monitor/';\n\n case 'KUBERNETES_CLUSTER':\n return 'ui/kubernetes/';\n\n case 'PROCESS_GROUP_INSTANCE':\n return '#processdetails;id=';\n\n default:\n return 'ui/entity/';\n }\n};\n\nexport const ProblemsList = (props: ProblemsListProps) => {\n const { dynatraceEntityId } = props;\n const configApi = useApi(configApiRef);\n const dynatraceApi = useApi(dynatraceApiRef);\n const dynatraceBaseUrl = configApi.getString('dynatrace.baseUrl');\n\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceProblems(dynatraceEntityId);\n }, [dynatraceApi, dynatraceEntityId]);\n const problems = value?.problems;\n\n const deepLinkPrefix = dynatraceEntityPrefixes(\n `${dynatraceEntityId.split('-')[0]}`,\n );\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n return (\n <InfoCard\n title=\"Problems\"\n subheader={`Last 2 hours - ${dynatraceEntityId}`}\n deepLink={{\n title: 'View Entity in Dynatrace',\n link: `${dynatraceBaseUrl}/${deepLinkPrefix}${dynatraceEntityId}`,\n }}\n >\n {cardContents(problems || [], dynatraceBaseUrl)}\n </InfoCard>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport Chip from '@material-ui/core/Chip';\nimport { dynatraceApiRef } from '../../../api';\n\ntype SyntheticsLocationProps = {\n lastFailedTimestamp: Date;\n locationId: string;\n key: string;\n};\n\nconst failedInLastXHours = (timestamp: Date, offset: number): boolean => {\n if (offset < 0 || offset > 24)\n throw new Error('offset must be between 0 and 24');\n return timestamp > new Date(new Date().getTime() - 1000 * 60 * 60 * offset);\n};\n\nconst chipColor = (timestamp: Date): string => {\n if (failedInLastXHours(timestamp, 1)) {\n return 'salmon';\n }\n if (failedInLastXHours(timestamp, 6)) {\n return 'sandybrown';\n }\n if (failedInLastXHours(timestamp, 24)) {\n return 'palegoldenrod';\n }\n return 'lightgreen';\n};\n\nexport const SyntheticsLocation = (props: SyntheticsLocationProps) => {\n const { lastFailedTimestamp, locationId } = props;\n const dynatraceApi = useApi(dynatraceApiRef);\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceSyntheticLocationInfo(\n `SYNTHETIC_LOCATION-00000000000000${locationId}`,\n );\n });\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Chip\n label={`${value?.name}${\n failedInLastXHours(new Date(lastFailedTimestamp), 24)\n ? `: failed @ ${lastFailedTimestamp.toLocaleTimeString()}`\n : ''\n }`}\n size=\"medium\"\n style={{ backgroundColor: chipColor(lastFailedTimestamp) }}\n />\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { InfoCard } from '@backstage/core-components';\nimport { useApi, configApiRef } from '@backstage/core-plugin-api';\nimport { dynatraceApiRef } from '../../../api';\nimport { SyntheticsLocation } from '../SyntheticsLocation';\n\ntype SyntheticsCardProps = {\n syntheticsId: string;\n};\n\nconst dynatraceMonitorPrefixes = (idPrefix: string): string => {\n switch (idPrefix) {\n case 'HTTP_CHECK':\n return 'ui/http-monitor';\n case 'BROWSER_MONITOR':\n return 'ui/browser-monitor';\n case 'SYNTHETIC_TEST':\n return 'ui/browser-monitor';\n default:\n throw new Error('Invalid synthetic Id');\n }\n};\n\nexport const SyntheticsCard = (props: SyntheticsCardProps) => {\n const { syntheticsId } = props;\n const configApi = useApi(configApiRef);\n const dynatraceApi = useApi(dynatraceApiRef);\n const dynatraceBaseUrl = configApi.getString('dynatrace.baseUrl');\n\n const { value, loading, error } = useAsync(async () => {\n return dynatraceApi.getDynatraceSyntheticFailures(syntheticsId);\n }, [dynatraceApi, syntheticsId]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const deepLinkPrefix = dynatraceMonitorPrefixes(\n `${syntheticsId.split('-')[0]}`,\n );\n\n const lastFailed = value?.locationsExecutionResults.map(l => {\n return {\n timestamp: l.requestResults[0].startTimestamp,\n location: Number(l.locationId).toString(16),\n };\n });\n\n return (\n <InfoCard\n title=\"Synthetics\"\n subheader={`Recent Activity for Monitor ${syntheticsId}`}\n deepLink={{\n title: 'View this Synthetic in Dynatrace',\n link: `${dynatraceBaseUrl}/${deepLinkPrefix}/${syntheticsId}`,\n }}\n >\n {lastFailed?.map(l => {\n return (\n <SyntheticsLocation\n key={l.location}\n lastFailedTimestamp={new Date(l.timestamp)}\n locationId={l.location}\n />\n );\n })}\n </InfoCard>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport { Page, Content } from '@backstage/core-components';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { ProblemsList } from '../Problems/ProblemsList';\nimport { SyntheticsCard } from '../Synthetics/SyntheticsCard';\nimport { isDynatraceAvailable } from '../../plugin';\nimport {\n DYNATRACE_ID_ANNOTATION,\n DYNATRACE_SYNTHETICS_ANNOTATION,\n} from '../../constants';\n\nexport const DynatraceTab = () => {\n const { entity } = useEntity();\n\n if (!isDynatraceAvailable(entity)) {\n return <MissingAnnotationEmptyState annotation={DYNATRACE_ID_ANNOTATION} />;\n }\n\n const dynatraceEntityId: string =\n entity?.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]!;\n\n const syntheticsIds: string =\n entity?.metadata.annotations?.[DYNATRACE_SYNTHETICS_ANNOTATION]!;\n\n return (\n <Page themeId=\"tool\">\n <Content>\n <Grid container spacing={2}>\n {dynatraceEntityId ? (\n <Grid item xs={12} lg={12}>\n <ProblemsList dynatraceEntityId={dynatraceEntityId} />\n </Grid>\n ) : (\n ''\n )}\n {syntheticsIds\n ?.split(/[ ,]/)\n .filter(Boolean)\n .map(id => {\n return (\n <Grid item xs={12} lg={12}>\n <SyntheticsCard syntheticsId={id} />\n </Grid>\n );\n })}\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAmBO,MAAM,aAAgB,GAAA,CAAC,EAAE,MAAA,EAAwC,KAAA;AACtE,EAAA,QAAQ,iCAAQ,iBAAqB,EAAA;AAAA,IACnC,KAAK,MAAA;AACH,MAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,IAAA,CAAA,EAAE,MAEjB,CAAA,CAAA;AAAA,IAEJ,KAAK,QAAA;AACH,MAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,IAAA,CAAA,EAAE,QAEd,CAAA,CAAA;AAAA,IAEJ;AACE,MAAA,uBAAS,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA,CAAA;A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A,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAQ,QAAS,CAAA,WAAA,KAAjB,IAA+B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,uBAAA,CAAA,CAAA;AAEjC,EAAA,MAAM,aACJ,GAAA,CAAA,EAAA,GAAA,MAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAQ,QAAS,CAAA,WAAA,KAAjB,IAA+B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,+BAAA,CAAA,CAAA;AAEjC,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,OAAQ,EAAA,MAAA,EAAA,sCACX,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAS,CACtB,EAAA,EAAA,iBAAA,uCACE,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EAAI,EAAA,EAAA,EAAI,EACrB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAa,iBAAsC,EAAA,CACtD,CAEA,GAAA,EAAA,EAED,+CACG,KAAM,CAAA,MAAA,CAAA,CACP,MAAO,CAAA,OAAA,CAAA,CACP,IAAI,CAAM,EAAA,KAAA;AACT,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAI,EAAI,EAAA,EAAA,EAAA,kBACpB,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,YAAc,EAAA,EAAA,EAAI,CACpC,CAAA,CAAA;AAAA,GAEJ,CACJ,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,104 @@
1
+ import { createApiRef, createRouteRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
2
+
3
+ const dynatraceApiRef = createApiRef({
4
+ id: "plugin.dynatrace.service"
5
+ });
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __publicField = (obj, key, value) => {
10
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11
+ return value;
12
+ };
13
+ class DynatraceClient {
14
+ constructor({
15
+ discoveryApi,
16
+ fetchApi
17
+ }) {
18
+ __publicField(this, "discoveryApi");
19
+ __publicField(this, "fetchApi");
20
+ this.discoveryApi = discoveryApi;
21
+ this.fetchApi = fetchApi;
22
+ }
23
+ async callApi(path, query) {
24
+ const apiUrl = `${await this.discoveryApi.getBaseUrl("proxy")}/dynatrace`;
25
+ const response = await this.fetchApi.fetch(
26
+ `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,
27
+ {
28
+ headers: {
29
+ "Content-Type": "application/json"
30
+ }
31
+ }
32
+ );
33
+ if (response.status === 200) {
34
+ return await response.json();
35
+ }
36
+ throw new Error(
37
+ `Dynatrace API call failed: ${response.status}:${response.statusText}`
38
+ );
39
+ }
40
+ async getDynatraceSyntheticFailures(syntheticsId) {
41
+ if (!syntheticsId) {
42
+ throw new Error("Dynatrace syntheticId is required");
43
+ }
44
+ return this.callApi(
45
+ `synthetic/execution/${encodeURIComponent(syntheticsId)}/FAILED`,
46
+ {}
47
+ );
48
+ }
49
+ async getDynatraceSyntheticLocationInfo(syntheticLocationId) {
50
+ if (!syntheticLocationId) {
51
+ throw new Error("Dynatrace syntheticLocationId is required");
52
+ }
53
+ return this.callApi(
54
+ `synthetic/locations/${encodeURIComponent(syntheticLocationId)}`,
55
+ {}
56
+ );
57
+ }
58
+ async getDynatraceProblems(dynatraceEntityId) {
59
+ if (!dynatraceEntityId) {
60
+ throw new Error("Dynatrace entity id is required");
61
+ }
62
+ return this.callApi("problems", {
63
+ entitySelector: `entityId(${dynatraceEntityId})`
64
+ });
65
+ }
66
+ }
67
+
68
+ const DYNATRACE_ID_ANNOTATION = "dynatrace.com/dynatrace-entity-id";
69
+ const DYNATRACE_SYNTHETICS_ANNOTATION = "dynatrace.com/synthetics-ids";
70
+
71
+ const rootRouteRef = createRouteRef({
72
+ id: "dynatrace"
73
+ });
74
+
75
+ const dynatracePlugin = createPlugin({
76
+ id: "dynatrace",
77
+ apis: [
78
+ createApiFactory({
79
+ api: dynatraceApiRef,
80
+ deps: {
81
+ discoveryApi: discoveryApiRef,
82
+ fetchApi: fetchApiRef
83
+ },
84
+ factory: ({ discoveryApi, fetchApi }) => new DynatraceClient({
85
+ discoveryApi,
86
+ fetchApi
87
+ })
88
+ })
89
+ ]
90
+ });
91
+ const isDynatraceAvailable = (entity) => {
92
+ var _a, _b;
93
+ return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[DYNATRACE_ID_ANNOTATION]) || Boolean((_b = entity.metadata.annotations) == null ? void 0 : _b[DYNATRACE_SYNTHETICS_ANNOTATION]);
94
+ };
95
+ const DynatraceTab = dynatracePlugin.provide(
96
+ createRoutableExtension({
97
+ name: "DynatraceTab",
98
+ component: () => import('./index-CHd0IpuU.esm.js').then((m) => m.DynatraceTab),
99
+ mountPoint: rootRouteRef
100
+ })
101
+ );
102
+
103
+ export { DYNATRACE_ID_ANNOTATION as D, DYNATRACE_SYNTHETICS_ANNOTATION as a, dynatracePlugin as b, DynatraceTab as c, dynatraceApiRef as d, isDynatraceAvailable as i };
104
+ //# sourceMappingURL=index-DHDulpiV.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DHDulpiV.esm.js","sources":["../../src/api/DynatraceApi.ts","../../src/api/DynatraceClient.ts","../../src/constants.ts","../../src/routes.ts","../../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport type DynatraceEntity = {\n entityId: {\n id: string;\n type: string;\n };\n name: string;\n};\n\nexport type DynatraceProblem = {\n problemId: string;\n impactLevel: string;\n status: string;\n startTime: number;\n endTime: number;\n title: string;\n severityLevel: string;\n rootCauseEntity: DynatraceEntity;\n affectedEntities: Array<DynatraceEntity>;\n};\n\ntype SyntheticRequestResults = {\n startTimestamp: number;\n};\n\nexport interface DynatraceSyntheticResults {\n monitorId: string;\n locationsExecutionResults: [\n {\n locationId: number;\n executionId: string;\n requestResults: Array<SyntheticRequestResults>;\n },\n ];\n}\n\nexport interface DynatraceSyntheticLocationInfo {\n entityId: string;\n name: string;\n city: string;\n browserType: string;\n}\n\nexport interface DynatraceProblems {\n problems: Array<DynatraceProblem>;\n totalCount: number;\n pageSize: number;\n}\n\nexport const dynatraceApiRef = createApiRef<DynatraceApi>({\n id: 'plugin.dynatrace.service',\n});\n\nexport type DynatraceApi = {\n getDynatraceProblems(\n dynatraceEntityId: string,\n ): Promise<DynatraceProblems | undefined>;\n getDynatraceSyntheticFailures(\n syntheticsId: string,\n ): Promise<DynatraceSyntheticResults | undefined>;\n getDynatraceSyntheticLocationInfo(\n syntheticLocationId: string,\n ): Promise<DynatraceSyntheticLocationInfo | undefined>;\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n DynatraceProblems,\n DynatraceApi,\n DynatraceSyntheticResults,\n DynatraceSyntheticLocationInfo,\n} from './DynatraceApi';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\n\nexport class DynatraceClient implements DynatraceApi {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n\n constructor({\n discoveryApi,\n fetchApi,\n }: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n }) {\n this.discoveryApi = discoveryApi;\n this.fetchApi = fetchApi;\n }\n\n private async callApi<T>(\n path: string,\n query: { [key in string]: any },\n ): Promise<T | undefined> {\n const apiUrl = `${await this.discoveryApi.getBaseUrl('proxy')}/dynatrace`;\n const response = await this.fetchApi.fetch(\n `${apiUrl}/${path}?${new URLSearchParams(query).toString()}`,\n {\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n if (response.status === 200) {\n return (await response.json()) as T;\n }\n throw new Error(\n `Dynatrace API call failed: ${response.status}:${response.statusText}`,\n );\n }\n\n async getDynatraceSyntheticFailures(\n syntheticsId: string,\n ): Promise<DynatraceSyntheticResults | undefined> {\n if (!syntheticsId) {\n throw new Error('Dynatrace syntheticId is required');\n }\n\n return this.callApi(\n `synthetic/execution/${encodeURIComponent(syntheticsId)}/FAILED`,\n {},\n );\n }\n\n async getDynatraceSyntheticLocationInfo(\n syntheticLocationId: string,\n ): Promise<DynatraceSyntheticLocationInfo | undefined> {\n if (!syntheticLocationId) {\n throw new Error('Dynatrace syntheticLocationId is required');\n }\n\n return this.callApi(\n `synthetic/locations/${encodeURIComponent(syntheticLocationId)}`,\n {},\n );\n }\n\n async getDynatraceProblems(\n dynatraceEntityId: string,\n ): Promise<DynatraceProblems | undefined> {\n if (!dynatraceEntityId) {\n throw new Error('Dynatrace entity id is required');\n }\n\n return this.callApi('problems', {\n entitySelector: `entityId(${dynatraceEntityId})`,\n });\n }\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const DYNATRACE_ID_ANNOTATION = 'dynatrace.com/dynatrace-entity-id';\nexport const DYNATRACE_SYNTHETICS_ANNOTATION = 'dynatrace.com/synthetics-ids';\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'dynatrace',\n});\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { dynatraceApiRef, DynatraceClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nimport { Entity } from '@backstage/catalog-model';\nimport {\n DYNATRACE_ID_ANNOTATION,\n DYNATRACE_SYNTHETICS_ANNOTATION,\n} from './constants';\n\nimport { rootRouteRef } from './routes';\n\n/**\n * Create the Dynatrace plugin.\n * @public\n */\nexport const dynatracePlugin = createPlugin({\n id: 'dynatrace',\n apis: [\n createApiFactory({\n api: dynatraceApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new DynatraceClient({\n discoveryApi,\n fetchApi,\n }),\n }),\n ],\n});\n\n/**\n * Checks if the entity has a dynatrace id annotation.\n * @public\n * @param entity - The entity to check for the dynatrace id annotation.\n */\nexport const isDynatraceAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[DYNATRACE_ID_ANNOTATION]) ||\n Boolean(entity.metadata.annotations?.[DYNATRACE_SYNTHETICS_ANNOTATION]);\n\n/**\n * Creates a routable extension for the dynatrace plugin tab.\n * @public\n */\nexport const DynatraceTab = dynatracePlugin.provide(\n createRoutableExtension({\n name: 'DynatraceTab',\n component: () =>\n import('./components/DynatraceTab').then(m => m.DynatraceTab),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;AAiEO,MAAM,kBAAkB,YAA2B,CAAA;AAAA,EACxD,EAAI,EAAA,0BAAA;AACN,CAAC;;;;;;;;AC5CM,MAAM,eAAwC,CAAA;AAAA,EAInD,WAAY,CAAA;AAAA,IACV,YAAA;AAAA,IACA,QAAA;AAAA,GAIC,EAAA;AATH,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,CAAA,CAAA;AACA,IAAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA;AASE,IAAA,IAAA,CAAK,YAAe,GAAA,YAAA,CAAA;AACpB,IAAA,IAAA,CAAK,QAAW,GAAA,QAAA,CAAA;AAAA,GAClB;AAAA,EAEA,MAAc,OACZ,CAAA,IAAA,EACA,KACwB,EAAA;AACxB,IAAA,MAAM,SAAS,CAAG,EAAA,MAAM,KAAK,YAAa,CAAA,UAAA,CAAW,OAAO,CAAC,CAAA,UAAA,CAAA,CAAA;AAC7D,IAAM,MAAA,QAAA,GAA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AAAA,IACN,SAAA,EAAW,MACT,OAAO,yBAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY,CAAA;AAAA,IAC9D,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH;;;;"}
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import * as react from 'react';
3
+ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
4
+ import { Entity } from '@backstage/catalog-model';
5
+
6
+ /**
7
+ * Create the Dynatrace plugin.
8
+ * @public
9
+ */
10
+ declare const dynatracePlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
11
+ /**
12
+ * Checks if the entity has a dynatrace id annotation.
13
+ * @public
14
+ * @param entity - The entity to check for the dynatrace id annotation.
15
+ */
16
+ declare const isDynatraceAvailable: (entity: Entity) => boolean;
17
+ /**
18
+ * Creates a routable extension for the dynatrace plugin tab.
19
+ * @public
20
+ */
21
+ declare const DynatraceTab: () => react.JSX.Element;
22
+
23
+ export { DynatraceTab, dynatracePlugin, isDynatraceAvailable };
@@ -0,0 +1,3 @@
1
+ export { c as DynatraceTab, b as dynatracePlugin, i as isDynatraceAvailable } from './esm/index-DHDulpiV.esm.js';
2
+ import '@backstage/core-plugin-api';
3
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}