Skip to content

Commit

Permalink
Add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww committed Dec 5, 2024
1 parent b21e3d3 commit fca8b8f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
## Upcoming Release

General:

- Add telemetry data collection to help improve the product. By default telemetry data will be collected. Add `--disableTelemetry` options disable telemetry data collection of this Azurite execution.

## 2024.10 Version 3.33.0

General:
Expand Down
4 changes: 3 additions & 1 deletion README.mcr.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 -v c:/azurite:/data mcr.
**Customize Azurite V3 supported parameters for docker image**

```bash
docker run -p 7777:7777 -p 8888:8888 -p 9999:9999 -v c:/azurite:/workspace mcr.microsoft.com/azure-storage/azurite azurite -l /workspace -d /workspace/debug.log --blobPort 7777 --blobHost 0.0.0.0 --queuePort 8888 --queueHost 0.0.0.0 --tablePort 9999 --tableHost 0.0.0.0 --loose --skipApiVersionCheck --disableProductStyleUrl
docker run -p 7777:7777 -p 8888:8888 -p 9999:9999 -v c:/azurite:/workspace mcr.microsoft.com/azure-storage/azurite azurite -l /workspace -d /workspace/debug.log --blobPort 7777 --blobHost 0.0.0.0 --queuePort 8888 --queueHost 0.0.0.0 --tablePort 9999 --tableHost 0.0.0.0 --loose --skipApiVersionCheck --disableProductStyleUrl --disableTelemetry
```

Above command will try to start Azurite image with configurations:
Expand All @@ -74,6 +74,8 @@ Above command will try to start Azurite image with configurations:

`--disableProductStyleUrl` force parsing storage account name from request URI path, instead of from request URI host.

`--disableTelemetry` disable telemetry data collection of this Azurite execution. By default, Azurite will collect telemetry data to help improve the product.

> If you use customized azurite parameters for docker image, `--blobHost 0.0.0.0`, `--queueHost 0.0.0.0` are required parameters.
> In above sample, you need to use **double first forward slash** for location and debug path parameters to avoid a [known issue](https://stackoverflow.com/questions/48427366/docker-build-command-add-c-program-files-git-to-the-path-passed-as-build-argu) for Git on Windows.
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ Following extension configurations are supported:
- `azurite.disableProductStyleUrl` Force parsing storage account name from request URI path, instead of from request URI host.
- `azurite.inMemoryPersistence` Disable persisting any data to disk. If the Azurite process is terminated, all data is lost.
- `azurite.extentMemoryLimit` When using in-memory persistence, limit the total size of extents (blob and queue content) to a specific number of megabytes. This does not limit blob, queue, or table metadata. Defaults to 50% of total memory.
- `azurite.disableTelemetry` Disable telemetry data collection of this Azurite execution. By default, Azurite will collect telemetry data to help improve the product.

### [DockerHub](https://hub.docker.com/_/microsoft-azure-storage-azurite)

Expand Down Expand Up @@ -236,7 +237,7 @@ docker run -p 10000:10000 -p 10001:10001 -v c:/azurite:/data mcr.microsoft.com/a
#### Customize all Azurite V3 supported parameters for docker image

```bash
docker run -p 7777:7777 -p 8888:8888 -p 9999:9999 -v c:/azurite:/workspace mcr.microsoft.com/azure-storage/azurite azurite -l /workspace -d /workspace/debug.log --blobPort 7777 --blobHost 0.0.0.0 --blobKeepAliveTimeout 5 --queuePort 8888 --queueHost 0.0.0.0 --queueKeepAliveTimeout 5 --tablePort 9999 --tableHost 0.0.0.0 --tableKeepAliveTimeout 5 --loose --skipApiVersionCheck --disableProductStyleUrl
docker run -p 7777:7777 -p 8888:8888 -p 9999:9999 -v c:/azurite:/workspace mcr.microsoft.com/azure-storage/azurite azurite -l /workspace -d /workspace/debug.log --blobPort 7777 --blobHost 0.0.0.0 --blobKeepAliveTimeout 5 --queuePort 8888 --queueHost 0.0.0.0 --queueKeepAliveTimeout 5 --tablePort 9999 --tableHost 0.0.0.0 --tableKeepAliveTimeout 5 --loose --skipApiVersionCheck --disableProductStyleUrl --disableTelemetry
```

Above command will try to start Azurite image with configurations:
Expand Down Expand Up @@ -269,6 +270,8 @@ Above command will try to start Azurite image with configurations:

`--disableProductStyleUrl` force parsing storage account name from request URI path, instead of from request URI host.

`--azurite.disableTelemetry` disable telemetry data collection of this Azurite execution. By default, Azurite will collect telemetry data to help improve the product.

> If you use customized azurite parameters for docker image, `--blobHost 0.0.0.0`, `--queueHost 0.0.0.0` are required parameters.
> In above sample, you need to use **double first forward slash** for location and debug path parameters to avoid a [known issue](https://stackoverflow.com/questions/48427366/docker-build-command-add-c-program-files-git-to-the-path-passed-as-build-argu) for Git on Windows.
Expand Down Expand Up @@ -442,6 +445,14 @@ Optional. When using FQDN instead of IP in request URI host, by default Azurite
--disableProductStyleUrl
```

### Disable Telemetry Collection

Optional. By default, Azurite will collect telemetry data to help improve the product. Disable telemetry data collection of this Azurite execution by:

```cmd
--disableTelemetry
```

### Use in-memory storage

Optional. Disable persisting any data to disk and only store data in-memory. If the Azurite process is terminated, all
Expand Down Expand Up @@ -989,7 +1000,7 @@ Detailed support matrix:
- OAuth authentication
- Shared Access Signature Account Level
- Shared Access Signature Service Level (Not support response header override in service SAS)
- Container Public Access
- Container Public Access
- Blob Tags (preview)
- Supported REST APIs
- List Containers
Expand Down
22 changes: 13 additions & 9 deletions src/common/Telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import * as fs from "fs";
import uuid from "uuid";
import { join } from "path";
import logger from "./Logger";
import { DEFAULT_BLOB_KEEP_ALIVE_TIMEOUT, DEFAULT_BLOB_LISTENING_PORT, DEFAULT_BLOB_SERVER_HOST_NAME } from "../blob/utils/constants";
import { DEFAULT_QUEUE_LISTENING_PORT } from "../queue/utils/constants";
import { DEFAULT_TABLE_LISTENING_PORT } from "../table/utils/constants";

export class AzuriteTelemetryClient {
private static eventClient : TelemetryClient | undefined;
Expand All @@ -34,7 +37,7 @@ export class AzuriteTelemetryClient {
public static isVSC = false;

// Debug options
private static isDebug = false;
private static isDebug = true; // change to false in production
private static requestCollectPercentage = AzuriteTelemetryClient.isDebug ? 100 : 1;
private static enableAppInsightLog = AzuriteTelemetryClient.isDebug? true : false;
private static cloudRole = AzuriteTelemetryClient.isDebug ? "AzuriteTest" : "Azurite";
Expand Down Expand Up @@ -147,7 +150,7 @@ export class AzuriteTelemetryClient {
authorization: context.request !== undefined ? AzuriteTelemetryClient.GetRequestAuthentication(context.request.getHeader("authorization"), context.request.getQuery("sig")) : "",
instanceID: AzuriteTelemetryClient.instanceID,
sessionID: AzuriteTelemetryClient.sessionID,
//totalReqs:AzuriteTelemetryClient._totalBlobRequestCount,
totalReqs:AzuriteTelemetryClient._totalBlobRequestCount,
};
if (context.request?.getHeader("content-length") !== undefined)
{
Expand Down Expand Up @@ -198,12 +201,13 @@ export class AzuriteTelemetryClient {
authorization: context.request !== undefined ? AzuriteTelemetryClient.GetRequestAuthentication(context.request.getHeader("authorization"), context.request.getQuery("sig")) : "",
instanceID: AzuriteTelemetryClient.instanceID,
sessionID: AzuriteTelemetryClient.sessionID,
//totalReqs:AzuriteTelemetryClient._totalQueueRequestCount,
totalReqs:AzuriteTelemetryClient._totalQueueRequestCount,
};
if (context.request?.getHeader("content-length") !== undefined)
{
requestProperties["requestContentSize"] = context.request?.getHeader("content-length");
}
// Responds "content-length" Not work, as responds normally don't have "content-length" header even has body.
AzuriteTelemetryClient.requestClient.trackRequest(
{
name:"Q_" + QueueOperation[context.operation??0],
Expand Down Expand Up @@ -242,7 +246,7 @@ export class AzuriteTelemetryClient {
authorization: context.request !== undefined ? AzuriteTelemetryClient.GetRequestAuthentication(context.request.getHeader("authorization"), context.request.getQuery("sig")) : "",
instanceID: AzuriteTelemetryClient.instanceID,
sessionID: AzuriteTelemetryClient.sessionID,
// totalReqs:AzuriteTelemetryClient._totalTableRequestCount,
totalReqs:AzuriteTelemetryClient._totalTableRequestCount,
};
if (context.request?.getHeader("content-length") !== undefined)
{
Expand Down Expand Up @@ -428,11 +432,11 @@ export class AzuriteTelemetryClient {
longParameters.forEach((flag) => {
let value = workspaceConfiguration.get(flag);
if (value !== undefined && value !== "" && value !== false && value !== null
&& !(flag.endsWith("Host") && value === "localhost")
&& !(flag.endsWith("KeepAliveTimeout") && value === 5)
&& !(flag == "blobPort" && value === 10000)
&& !(flag == "queuePort" && value === 10001)
&& !(flag == "tablePort" && value === 10002))
&& !(flag.endsWith("Host") && value === DEFAULT_BLOB_SERVER_HOST_NAME)
&& !(flag.endsWith("KeepAliveTimeout") && value === DEFAULT_BLOB_KEEP_ALIVE_TIMEOUT)
&& !(flag == "blobPort" && value === DEFAULT_BLOB_LISTENING_PORT)
&& !(flag == "queuePort" && value === DEFAULT_QUEUE_LISTENING_PORT)
&& !(flag == "tablePort" && value === DEFAULT_TABLE_LISTENING_PORT))
{
parameters += flag + ",";
}
Expand Down

0 comments on commit fca8b8f

Please sign in to comment.