Skip to content

Commit 9e79995

Browse files
committed
full edit management topics(3)
1 parent b14a510 commit 9e79995

File tree

8 files changed

+118
-104
lines changed

8 files changed

+118
-104
lines changed

api/v4/management/cloud-foundry.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@ Integration with [Tanzu Apps Manager](https://techdocs.broadcom.com/us/en/vmware
55
When used, this endpoint enables the following additional functionality on Cloud Foundry:
66

77
* A variant of the [hypermedia](./hypermedia.md) endpoint is registered at `/cloudfoundryapplication`.
8-
* All endpoints are additionally mapped under the base path `/cloudfoundryapplication`.
8+
* All endpoints are also mapped under the base path `/cloudfoundryapplication`.
99
* [Authentication and authorization](#security) for your Cloud Foundry environment is added to the request pipeline.
1010

1111
> [!NOTE]
12-
> The Cloud Foundry integration will not work unless the [Cloud Foundry Configuration Provider](../configuration/cloud-foundry-provider.md) has also been configured.
12+
> The Cloud Foundry integration works only when the [Cloud Foundry Configuration Provider](../configuration/cloud-foundry-provider.md) has also been configured.
1313
1414
## Configure Settings
1515

1616
Typically, no additional configuration is needed. However, the following table describes the configuration settings that you can apply to the Cloud Foundry endpoint.
1717
Each key must be prefixed with `Management:Endpoints:CloudFoundry`.
1818

1919
| Key | Description | Default |
20-
| --- | --- | --- |
21-
| `Enabled` | Whether the endpoint is enabled. | `true` |
22-
| `ID` | The unique ID of the endpoint. | `""` |
23-
| `Path` | The relative path at which the endpoint is exposed. | same as `ID` |
24-
| `RequiredPermissions` | Permissions required to access the endpoint, when running on Cloud Foundry. | `Restricted` |
25-
| `AllowedVerbs` | An array of HTTP verbs the endpoint is exposed at. | `GET` |
26-
| `ValidateCertificates` | Whether to validate server certificates. | `true` |
27-
| `ApplicationId` | The ID of the application used in permission checks. | |
28-
| `CloudFoundryApi` | The URL of the Cloud Foundry API. | |
20+
| --- | ----------- | ------- |
21+
| `Enabled` | Whether the endpoint is enabled | `true` |
22+
| `ID` | The unique ID of the endpoint | `""` |
23+
| `Path` | The relative path at which the endpoint is exposed | same as `ID` |
24+
| `RequiredPermissions` | Permissions required to access the endpoint when running on Cloud Foundry | `Restricted` |
25+
| `AllowedVerbs` | An array of HTTP verbs at which the endpoint is exposed | `GET` |
26+
| `ValidateCertificates` | Whether to validate server certificates | `true` |
27+
| `ApplicationId` | The ID of the application used in permission checks | |
28+
| `CloudFoundryApi` | The URL of the Cloud Foundry API | |
2929

3030
## Enable HTTP Access
3131

32-
The URL path to the endpoint is computed by combining the global `Management:Endpoints:Path` setting together with the `Path` setting described in the preceding section.
32+
The URL path to the endpoint is computed by combining the global `Management:Endpoints:Path` setting with the `Path` setting described in the preceding section.
3333
The default path is `/cloudfoundryapplication`.
3434

35-
See the [Exposing Endpoints](./using-endpoints.md#exposing-endpoints) and [HTTP Access](./using-endpoints.md#http-access) sections for the overall steps required to enable HTTP access to endpoints in an ASP.NET Core application.
35+
See the [Exposing Endpoints](./using-endpoints.md#exposing-endpoints) and [HTTP Access](./using-endpoints.md#http-access) sections for the steps required to enable HTTP access to endpoints in an ASP.NET Core application.
3636

37-
To add the actuator to the service container, add a [CORS](#cross-origin-resource-sharing) policy, register security middleware and map its route, use the `AddCloudFoundryActuator` extension method.
37+
To add the actuator to the service container, add a [CORS](#cross-origin-resource-sharing) policy, register security middleware and map its route, and use the `AddCloudFoundryActuator` extension method.
3838

3939
Add the following code to `Program.cs` to use the actuator endpoint:
4040

@@ -53,10 +53,10 @@ builder.Services.AddCloudFoundryActuator();
5353
5454
### Cross Origin Resource Sharing
5555

56-
When viewing an application in Apps Manager, HTTP requests are sent directly to application instances with the bearer token of the logged-in user attached.
56+
When viewing an application in Apps Manager, HTTP requests are sent directly to application instances, with the bearer token of the logged-in user attached.
5757
The nature of this integration requires the use of Cross Origin Resource Sharing ([CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)).
58-
The policy defined in Steeltoe intends to limit sharing to the minimum required for the endpoints to function, however there is no way for Steeltoe to discover or even guess at what the origin of an Apps Manager instance could be.
59-
As such, the default policy will allow any origin, unless the policy is customized. You should consider [customizing the CORS policy](./using-endpoints.md#customizing-the-cors-policy) to be more specific.
58+
The policy defined in Steeltoe intends to limit sharing to the minimum required for the endpoints to function; however, there is no way for Steeltoe to discover or infer what the origin of an Apps Manager instance could be.
59+
As such, the default policy allows any origin, unless the policy is customized. You should consider [customizing the CORS policy](./using-endpoints.md#customizing-the-cors-policy) to be more specific.
6060

6161
## Security
6262

@@ -65,7 +65,7 @@ The Cloud Foundry security middleware requires a valid UAA access token to be pr
6565
Additionally, the security middleware evaluates the token to determine whether the authenticated user has permission to access the management endpoint.
6666

6767
> [!NOTE]
68-
> The Cloud Foundry security middleware is only active when your application is running on Cloud Foundry.
68+
> The Cloud Foundry security middleware is active only when your application is running on Cloud Foundry.
6969
7070
## External access
7171

@@ -77,5 +77,5 @@ For this reason, all endpoints are exposed by default at `/cloudfoundryapplicati
7777
In addition, the endpoints may be secured by whatever security mechanism the application itself uses. For more details, see [securing actuators](./using-endpoints.md#securing-endpoints).
7878

7979
> [!CAUTION]
80-
> Applying an authorization policy on `/actuator` will also impact `/cloudfoundryapplication`, which will break the integration with Apps Manager.
81-
> In order to prevent public access to `/actuator` when running on Cloud Foundry, consider configuring actuators to [use an alternate port](./using-endpoints.md#configure-global-settings).
80+
> Applying an authorization policy on `/actuator` also has an impact on `/cloudfoundryapplication`, which then breaks the integration with Apps Manager.
81+
> To prevent public access to `/actuator` when running on Cloud Foundry, consider configuring actuators to [use an alternate port](./using-endpoints.md#configure-global-settings).

api/v4/management/health.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ When `ShowComponents` and `ShowDetails` are set to `Always`, or when set to `Whe
152152
153153
## Health Groups
154154

155-
If you need to check application health based on a subset of health contributors, you can specify the name of the grouping and a comma-separated list of contributors to include:
155+
If you want to check application health based on a subset of health contributors, you can specify the name of the grouping and a comma-separated list of contributors to include:
156156

157157
```json
158158
{

api/v4/management/prometheus.md

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The Steeltoe Prometheus endpoint configures the [OpenTelemetry Prometheus Export
66

77
The Prometheus endpoint does not automatically instrument your application, but does make it easy to export metrics in the Prometheus metrics format, which can be used by tools like [Prometheus Server](https://prometheus.io/) and the [Metric Registrar for Tanzu Platform for Cloud Foundry](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform/tanzu-platform-for-cloud-foundry/10-0/tpcf/metric-registrar-index.html).
88

9-
The [Steeltoe Management samples](https://github.com/SteeltoeOSS/Samples/tree/main/Management/src/ActuatorWeb/README.md) can help you understand how to use this tool.
9+
See the [Steeltoe Management samples](https://github.com/SteeltoeOSS/Samples/tree/main/Management/src/ActuatorWeb/README.md) for more information about using this tool.
1010

1111
## Add NuGet Reference
1212

13-
To use the Prometheus endpoint, you need to add a reference to the `Steeltoe.Management.Prometheus` NuGet package.
13+
To use the Prometheus endpoint, add a reference to the `Steeltoe.Management.Prometheus` NuGet package.
1414

1515
## Configure Settings
1616

@@ -26,7 +26,7 @@ Each key must be prefixed with `Management:Endpoints:Prometheus:`.
2626
| `AllowedVerbs` | An array of HTTP verbs at which the endpoint is exposed | `GET` |
2727

2828
> [!NOTE]
29-
> The `AllowedVerbs` setting is inherited from Steeltoe's `EndpointOptions`, but is not intended to work for the Prometheus exporter, which is only registered to respond to `GET` requests.
29+
> The `AllowedVerbs` setting is inherited from the Steeltoe `EndpointOptions`, but is not intended to work for the Prometheus exporter, which is only registered to respond to `GET` requests.
3030
3131
## Enable HTTP Access
3232

@@ -49,59 +49,65 @@ builder.Services.AddPrometheusActuator();
4949
### Configuring the request pipeline for Prometheus
5050

5151
In addition to the options described in [using endpoints](./using-endpoints.md), `AddPrometheusActuator` exposes an `Action<IApplicationBuilder>?` that can be used to configure the branched request pipeline that is used in the underlying OpenTelemetry package.
52-
This pipeline would need to be configured if, as an example, you are configuring an authorization policy.
52+
This pipeline must be configured if, as an example, you are configuring an authorization policy.
5353

5454
```csharp
5555
builder.Services.AddPrometheusActuator(true, pipeline => pipeline.UseAuthorization());
5656
```
5757

5858
## Instrumentation
5959

60-
In order for the Prometheus endpoint to return metrics, the application and relevant libraries need to be instrumented.
61-
This page will cover the basics for elements that previous versions of Steeltoe configured automatically.
62-
Please refer to the [OpenTelemetry documentation](https://opentelemetry.io/docs/languages/net/instrumentation/) for more detailed information.
60+
For the Prometheus endpoint to return metrics, the application and relevant libraries must be instrumented.
61+
This topic covers the basics for elements that previous versions of Steeltoe configured automatically.
62+
Refer to the [OpenTelemetry documentation](https://opentelemetry.io/docs/languages/net/instrumentation/) for more detailed information.
6363

6464
### ASP.NET Core
6565

66-
To instrument ASP.NET Core for metrics, start by adding a reference to the `OpenTelemetry.Instrumentation.AspNetCore` NuGet package.
66+
To instrument ASP.NET Core for metrics:
6767

68-
Next, add the instrumentation to the `MeterProviderBuilder`:
68+
1. Add a reference to the `OpenTelemetry.Instrumentation.AspNetCore` NuGet package.
6969

70-
```csharp
71-
using OpenTelemetry.Metrics;
70+
1. Add the instrumentation to the `MeterProviderBuilder`:
7271

73-
builder.Services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddAspNetCoreInstrumentation());
74-
```
72+
```csharp
73+
using OpenTelemetry.Metrics;
74+
75+
builder.Services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddAspNetCoreInstrumentation());
76+
```
7577

76-
[Learn more about ASP.NET Core instrumentation for OpenTelemetry](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.AspNetCore)
78+
For more information about ASP.NET Core instrumentation for OpenTelemetry, see the [OpenTelemetry documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.AspNetCore).
7779
7880
### HttpClient
7981

80-
To instrument `HttpClient`s for metrics, start by adding a reference to the `OpenTelemetry.Instrumentation.Http` NuGet package.
82+
To instrument `HttpClient`s for metrics:
8183

82-
Next, add the instrumentation to the `MeterProviderBuilder`:
84+
1. Add a reference to the `OpenTelemetry.Instrumentation.Http` NuGet package.
8385

84-
```csharp
85-
using OpenTelemetry.Metrics;
86+
2. Add the instrumentation to the `MeterProviderBuilder`:
8687

87-
builder.Services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddHttpClientInstrumentation());
88-
```
88+
```csharp
89+
using OpenTelemetry.Metrics;
8990

90-
[Learn more about HttpClient instrumentation for OpenTelemetry](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http)
91+
builder.Services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddHttpClientInstrumentation());
92+
```
93+
94+
For more information about HttpClient instrumentation for OpenTelemetry, see the [OpenTelemetry documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http).
9195
9296
### .NET Runtime
9397

94-
To instrument the .NET Runtime for metrics, start by adding a reference to the `OpenTelemetry.Instrumentation.Runtime` NuGet package.
98+
To instrument the .NET Runtime for metrics:
9599

96-
Next, add the instrumentation to the `MeterProviderBuilder`:
100+
1. Add a reference to the `OpenTelemetry.Instrumentation.Runtime` NuGet package.
97101

98-
```csharp
99-
using OpenTelemetry.Metrics;
102+
1. Add the instrumentation to the `MeterProviderBuilder`:
100103

101-
builder.Services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddRuntimeInstrumentation());
102-
```
104+
```csharp
105+
using OpenTelemetry.Metrics;
106+
107+
builder.Services.AddOpenTelemetry().WithMetrics(metrics => metrics.AddRuntimeInstrumentation());
108+
```
103109

104-
[Learn more about Runtime Instrumentation for OpenTelemetry .NET](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Runtime)
110+
For more information about Runtime Instrumentation for OpenTelemetry .NET, see the [OpenTelemetry documentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Runtime).
105111
106112
### Prometheus Server
107113

@@ -111,7 +117,7 @@ As an example, the following `prometheus.yml` file configures metric scraping fo
111117

112118
```yml
113119
global:
114-
scrape_interval: 15s # Set the scrape interval to every 15 seconds. The default is every 1 minute.
120+
scrape_interval: 15 s # Set the scrape interval to every 15 seconds. The default is every 1 minute.
115121
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
116122
# scrape_timeout is set to the global default (10s).
117123
scrape_configs:
@@ -138,10 +144,10 @@ To emit custom metrics in Cloud Foundry, use [Metric Registrar](https://techdocs
138144
139145
> [!CAUTION]
140146
> Authenticated endpoints are not supported with Metric Registrar.
141-
> For this scenario, configure actuators to [use an alternate port](./using-endpoints.md#configure-global-settings) and use that private network port to offer the metrics.
147+
> For this scenario, configure actuators to use an [alternate port](./using-endpoints.md#configure-global-settings) and use that private network port to offer the metrics.
142148

143-
The examples below expect that actuators are mapped to an alternate port (8091 in this case).
144-
The specific port that is used is not important to Steeltoe, it only matters that the binding and Steeltoe configurations match.
149+
The following examples assume that actuators are mapped to an alternate port (8091 in this case).
150+
The specific port is not important to Steeltoe, it only matters that the binding and Steeltoe configurations match.
145151

146152
#### Metrics Registrar Plugin
147153

@@ -169,13 +175,13 @@ cf bind-service APP-NAME SERVICE-NAME
169175

170176
This endpoint returns information about the instrumented application metrics and their values.
171177

172-
If no instrumentation has been included, the response will be very short, like this:
178+
If no instrumentation has been included, the response is very short:
173179

174180
```text
175181
# EOF
176182
```
177183

178-
With the addition of [.NET Runtime instrumentation](#net-runtime), the response will be like this:
184+
With the addition of [.NET Runtime instrumentation](#net-runtime), the response is similar to the following:
179185

180186
```text
181187
# TYPE process_runtime_dotnet_gc_collections_count_total counter

api/v4/management/refresh.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ The following table describes the configuration settings that you can apply to t
99
Each key must be prefixed with `Management:Endpoints:Refresh:`.
1010

1111
| Key | Description | Default |
12-
| --- | --- | --- |
13-
| `Enabled` | Whether the endpoint is enabled. | `true` |
14-
| `ID` | The unique ID of the endpoint. | `refresh` |
15-
| `Path` | The relative path at which the endpoint is exposed. | same as `ID` |
16-
| `RequiredPermissions` | Permissions required to access the endpoint, when running on Cloud Foundry. | `Restricted` |
17-
| `AllowedVerbs` | An array of HTTP verbs the endpoint is exposed at. | `POST` |
18-
| `ReturnConfiguration` | Whether to return the configuration after refresh. | `true` |
12+
| --- | ----------- | ------- |
13+
| `Enabled` | Whether the endpoint is enabled | `true` |
14+
| `ID` | The unique ID of the endpoint | `refresh` |
15+
| `Path` | The relative path at which the endpoint is exposed | same as `ID` |
16+
| `RequiredPermissions` | Permissions required to access the endpoint when running on Cloud Foundry | `Restricted` |
17+
| `AllowedVerbs` | An array of HTTP verbs at which the endpoint is exposed | `POST` |
18+
| `ReturnConfiguration` | Whether to return the configuration after refresh | `true` |
1919

2020
> [!NOTE]
21-
> Despite being *possible* to configure this endpoint to respond to `GET` requests,
21+
> Despite it being *possible* to configure this endpoint to respond to `GET` requests,
2222
> this is discouraged because it is not a [Safe HTTP Method](https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP).
2323
2424
## Enable HTTP Access
2525

26-
The URL path to the endpoint is computed by combining the global `Management:Endpoints:Path` setting together with the `Path` setting described in the preceding section.
26+
The URL path to the endpoint is computed by combining the global `Management:Endpoints:Path` setting with the `Path` setting described in the preceding section.
2727
The default path is `/actuator/refresh`.
2828

29-
See the [Exposing Endpoints](./using-endpoints.md#exposing-endpoints) and [HTTP Access](./using-endpoints.md#http-access) sections for the overall steps required to enable HTTP access to endpoints in an ASP.NET Core application.
29+
See the [Exposing Endpoints](./using-endpoints.md#exposing-endpoints) and [HTTP Access](./using-endpoints.md#http-access) sections for the steps required to enable HTTP access to endpoints in an ASP.NET Core application.
3030

3131
To add the actuator to the service container and map its route, use the `AddRefreshActuator` extension method.
3232

@@ -47,7 +47,7 @@ builder.Services.AddRefreshActuator();
4747

4848
This endpoint returns an array of keys obtained from `IConfiguration`.
4949

50-
The response will always be returned as JSON, like this:
50+
The response always returns as JSON:
5151

5252
```json
5353
[

0 commit comments

Comments
 (0)