mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* feat(logs): add metric filters with per-event metric publication Implements PutMetricFilter, DescribeMetricFilters, DeleteMetricFilter and TestMetricFilter on the CloudWatch Logs JSON 1.1 handler, backed by a filter pattern engine for term, space-delimited and JSON patterns. The grammar is checked against 148 TestMetricFilter cases recorded from AWS, kept as fixtures under src/test/resources/cloudwatchlogs and recaptured with the opt-in script under tools/aws-capture/cloudwatchlogs. Validation follows the observed AWS wire behavior: the five regex-bearing filters per log group quota is shared with subscription filters through one canonical backend monitor, a filter pattern may hold at most two regular expressions, defaultValue must be a JSON number, DescribeMetricFilters requires metricName and metricNamespace together in both directions, and TestMetricFilter reports one-based event numbers with an empty public extractedValues map for JSON patterns. Ingested events publish samples into CloudWatch Metrics per event at the event timestamp: matching events contribute the extracted or literal value, non-matching events contribute defaultValue, dimensions are all-or-none, and system dimensions only attach to matching events. Failed publications are retried from a bounded queue of 10,000 samples with stable publication ids. Resettable gains beforeReset and afterReset default hooks so the metric filter publisher can pause and drain before a state reset wipes storage and resume afterwards. EmulatorInfoController.performReset is serialized and calls the hooks around the existing container teardown and storage wipe, running afterReset in a finally block so a failed wipe cannot leave a publisher paused. The GetMetricStatistics and GetMetricData Query responses now carry the CloudWatch namespace so both read paths return the same samples. * feat(cloudformation): provision AWS::Logs::MetricFilter Adds LogsMetricFilterCfnProvisioner for creates, in-place updates, name changes and deletes. Ref and PhysicalResourceId are the filter name alone, as observed on AWS; the log group is kept as private resource metadata. A replacement deletes the old filter before creating the new one, matching the DELETE then CREATE event order AWS emits, and a failed replacement recreates the previous definition on rollback. Every mutation records an APPLIED, NOT_APPLIED or UNKNOWN outcome under the service lock so a failed or ambiguous call can never authorize deleting or overwriting a filter the stack does not own. Ownership that cannot be proven is resolved conservatively before the next mutation. The engine gains three small provisioner hooks that this type needs and others may reuse: - ProvisionContext carries a progress consumer so a provisioner can emit the intermediate DELETE_IN_PROGRESS and DELETE_COMPLETE events of a delete-first replacement while provision is still running. - rollbackUpdate(resource, progress) lets a provisioner restore its own previous state during UPDATE_ROLLBACK and report the steps as events. - hasPendingRollbackCleanup and retainsFailedUpdateState let a provisioner tell the engine that an UPDATE_FAILED resource still holds its own rollback snapshot, so the engine neither restores the previous resource over it nor refuses a later DeleteStack. Both default to false; only this provisioner overrides them. The type is listed in supported-resource-types.tsv, the generated resource table and CfnProvisionerFixture, with unit, integration, storage reload and SDK coverage. * docs(logs): document metric filters and the AWS verification record Describes the metric filter operations, publication semantics and CloudFormation support in docs/services/cloudwatch.md and adds cloudwatch-metric-filters-verification.md, the record of what was observed on AWS in eu-west-1, with which tools, and where each recorded fixture came from. Registers the handler and the verification page with the docs tooling and teaches the service inventory test to count facet pages. * feat(logs): publish metric filter samples off the PutLogEvents thread PutLogEvents evaluated each filter and wrote one CloudWatch Metrics sample per filter and event on the request thread while holding the filter-store monitor, up to a million writes for a maximal request, so ingestion latency depended on the Metrics sink and every PutMetricFilter waited behind the whole batch. The request thread now only evaluates the group's filters as they are at ingestion and hands the resulting immutable samples, with their stable publication ids, to a bounded queue of 100,000 samples. The existing single worker drains it and writes one sample per monitor acquisition, so a PutMetricFilter or a reset waits for at most one write. A batch that does not fit the queue is written inline on the request thread rather than dropped. Failed writes still land in the 10,000 sample retry map with the same ids and cadence as before. Reset pauses the worker, discards queued and failed samples and bumps a generation counter so a batch taken before the reset is never written into the wiped store. Shutdown drains the queue before storage shuts down and clears the retry map only after the worker has terminated. Samples ingested while Metrics is disabled are discarded at startup. Integration and SDK tests poll for the sample, as they would against AWS. * test(compat): assert recorded metric filter publishing through the SDK modules Extends the Java compatibility module with the publishing scenarios recorded from AWS: mixed defaults and quiet traffic, extraction and ordinary dimension series, system dimensions on matches only, and a Sum alarm driven by quiet defaults. Each series is read through the SDK's CloudWatch JSON protocol and again as a signed legacy Query request, so GetMetricStatistics and GetMetricData agree on every sample, timestamp, unit and dimension set. Expected values come from module-local copies of the root fixture metric-filter-publishing-aws.json. MetricFilterFixturePackagingTest checks the Java copy loads from the classpath and the root CloudWatchLogsMetricFilterFixturePackagingTest fails when either SDK module copy drifts from the root file. The Python module gains tests/metric_filter_replay.py, an opt-in replay of the same scenarios against a Floci endpoint or, with explicit profile, region and write acknowledgement, against AWS. Its logic is covered offline by tests/test_metric_filter_replay.py with the network blocked. Both module Dockerfiles are unchanged: the Java image already runs the whole suite and the Python image already copies tests/. * test(compat): assert every recorded statistic and poll for published samples The SDK publishing assertions compared only Sum and SampleCount although the AWS fixture also records Minimum and Maximum for the default-value scenarios. Both the SDK JSON reads and the signed legacy Query reads now assert every statistic the fixture carries, on GetMetricStatistics and GetMetricData. Publication now happens shortly after PutLogEvents returns, so present series are polled and absent series are asserted only after a later positive control of the same filter is visible, which the publisher's ordering guarantees. The read window ends at second 59 so a sample stamped on the following minute is never in scope. The live replay's Region check names the commercial partition explicitly. botocore already defaults get_available_regions to partition_name="aws", so GovCloud and China Regions were rejected before; the offline test now pins it. * test(compat): keep the metric filter SDK test on the Java 17 API of the compat image List.getLast() is Java 21; the sdk-test-java image compiles with Temurin 17.
229 lines
8.1 KiB
YAML
229 lines
8.1 KiB
YAML
site_name: Floci
|
|
site_description: Fast, free, open-source local AWS emulator
|
|
site_url: https://floci.io/floci/
|
|
repo_url: https://github.com/floci-io/floci
|
|
repo_name: floci-io/floci
|
|
edit_uri: edit/main/docs/
|
|
|
|
theme:
|
|
name: material
|
|
custom_dir: overrides
|
|
logo: assets/floci-header.svg
|
|
favicon: assets/floci.svg
|
|
palette:
|
|
- media: "(prefers-color-scheme: light)"
|
|
scheme: default
|
|
primary: custom
|
|
accent: custom
|
|
toggle:
|
|
icon: material/brightness-7
|
|
name: Switch to dark mode
|
|
- media: "(prefers-color-scheme: dark)"
|
|
scheme: slate
|
|
primary: custom
|
|
accent: custom
|
|
toggle:
|
|
icon: material/brightness-4
|
|
name: Switch to light mode
|
|
features:
|
|
- navigation.tabs
|
|
- navigation.sections
|
|
- navigation.top
|
|
- navigation.instant
|
|
- search.highlight
|
|
- search.suggest
|
|
- content.code.copy
|
|
- content.code.annotate
|
|
- content.tabs.link
|
|
|
|
# Fail the build on any warning so a docs page without a nav entry, or a broken link,
|
|
# is caught in CI instead of silently shipping unreachable (see floci-io/floci: eleven
|
|
# services/*.md pages went live without a nav line and nothing was red).
|
|
strict: true
|
|
validation:
|
|
nav:
|
|
omitted_files: warn
|
|
not_found: warn
|
|
absolute_links: warn
|
|
links:
|
|
not_found: warn
|
|
absolute_links: warn
|
|
unrecognized_links: warn
|
|
not_in_nav: |
|
|
configuration/application-yml.md
|
|
design/*.md
|
|
|
|
extra_css:
|
|
- assets/extra.css
|
|
|
|
plugins:
|
|
- search
|
|
|
|
markdown_extensions:
|
|
- admonition
|
|
- pymdownx.details
|
|
- pymdownx.superfences
|
|
- pymdownx.highlight:
|
|
anchor_linenums: true
|
|
- pymdownx.tabbed:
|
|
alternate_style: true
|
|
- pymdownx.inlinehilite
|
|
- tables
|
|
- attr_list
|
|
|
|
nav:
|
|
- Home: index.md
|
|
- Getting Started:
|
|
- Quick Start: getting-started/quick-start.md
|
|
- Installation: getting-started/installation.md
|
|
- AWS CLI & SDK Setup: getting-started/aws-setup.md
|
|
- Terraform: getting-started/terraform.md
|
|
- Migrate from LocalStack: getting-started/migrate-from-localstack.md
|
|
- Configuration:
|
|
- Environment Variables: configuration/environment-variables.md
|
|
- Docker Images: configuration/docker-images.md
|
|
- Docker Compose: configuration/docker-compose.md
|
|
- Docker Configuration: configuration/docker.md
|
|
- Ports Reference: configuration/ports.md
|
|
- Multi-Account Isolation: configuration/multi-account.md
|
|
- Storage Modes: configuration/storage.md
|
|
- TLS / HTTPS: configuration/tls.md
|
|
- Initialization Hooks: configuration/initialization-hooks.md
|
|
- Advanced:
|
|
- application.yml Reference: configuration/advanced/application-yml.md
|
|
- Services:
|
|
- Overview: services/index.md
|
|
- SSM Parameter Store: services/ssm.md
|
|
- SQS: services/sqs.md
|
|
- SNS: services/sns.md
|
|
- SES: services/ses.md
|
|
- S3: services/s3.md
|
|
- S3 Tables: services/s3tables.md
|
|
- S3 Vectors: services/s3vectors.md
|
|
- EFS: services/efs.md
|
|
- DynamoDB: services/dynamodb.md
|
|
- Lambda: services/lambda.md
|
|
- Lambda MicroVMs: services/lambda-microvms.md
|
|
- API Gateway: services/api-gateway.md
|
|
- Cognito: services/cognito.md
|
|
- Cognito Identity: services/cognitoidentity.md
|
|
- Global Accelerator: services/globalaccelerator.md
|
|
- KMS: services/kms.md
|
|
- CloudHSM v2: services/cloudhsmv2.md
|
|
- Kinesis: services/kinesis.md
|
|
- Managed Service for Apache Flink: services/kinesisanalytics.md
|
|
- Secrets Manager: services/secrets-manager.md
|
|
- CloudFormation: services/cloudformation.md
|
|
- Cloud Control API: services/cloudcontrol.md
|
|
- Step Functions: services/step-functions.md
|
|
- SWF: services/swf.md
|
|
- IAM: services/iam.md
|
|
- STS: services/sts.md
|
|
- Organizations: services/organizations.md
|
|
- AWS Account Management: services/account.md
|
|
- IAM Access Analyzer: services/access-analyzer.md
|
|
- IAM Identity Center (SSO Admin): services/ssoadmin.md
|
|
- IAM Identity Center (OIDC): services/ssooidc.md
|
|
- IAM Identity Center (Access Portal): services/ssoportal.md
|
|
- Identity Store: services/identitystore.md
|
|
- AWS Budgets: services/budgets.md
|
|
- Amazon Macie: services/macie2.md
|
|
- Amazon Inspector: services/inspector2.md
|
|
- Security Hub: services/securityhub.md
|
|
- Amazon Detective: services/detective.md
|
|
- Amazon Verified Permissions: services/verifiedpermissions.md
|
|
- Control Catalog: services/controlcatalog.md
|
|
- AWS Marketplace: services/marketplace.md
|
|
- Control Tower: services/controltower.md
|
|
- AWS Service Catalog: services/service-catalog.md
|
|
- ElastiCache: services/elasticache.md
|
|
- MemoryDB: services/memorydb.md
|
|
- RDS: services/rds.md
|
|
- RDS Data API: services/rds-data.md
|
|
- MSK (Kafka): services/msk.md
|
|
- Amazon MQ: services/amazonmq.md
|
|
- Glue: services/glue.md
|
|
- Lake Formation: services/lakeformation.md
|
|
- Neptune: services/neptune.md
|
|
- DocumentDB: services/docdb.md
|
|
- Athena: services/athena.md
|
|
- Redshift: services/redshift.md
|
|
- Redshift Data API: services/redshift-data.md
|
|
- Data Firehose: services/firehose.md
|
|
- EventBridge: services/eventbridge.md
|
|
- EventBridge Pipes: services/pipes.md
|
|
- EventBridge Scheduler: services/scheduler.md
|
|
- CloudWatch: services/cloudwatch.md
|
|
- CloudWatch Metric Filter Verification: services/cloudwatch-metric-filters-verification.md
|
|
- CloudWatch OAM: services/oam.md
|
|
- CloudWatch RUM: services/rum.md
|
|
- Managed Prometheus (AMP): services/managed-prometheus.md
|
|
- GuardDuty: services/guardduty.md
|
|
- Connect: services/connect.md
|
|
- AppIntegrations: services/appintegrations.md
|
|
- ACM: services/acm.md
|
|
- ECS: services/ecs.md
|
|
- ECR: services/ecr.md
|
|
- Resource Groups Tagging API: services/resource-groups-tagging.md
|
|
- Resource Explorer 2: services/resource-explorer.md
|
|
- EKS: services/eks.md
|
|
- MWAA: services/mwaa.md
|
|
- OpenSearch: services/opensearch.md
|
|
- EC2: services/ec2.md
|
|
- Lightsail: services/lightsail.md
|
|
- AppConfig: services/appconfig.md
|
|
- Bedrock: services/bedrock.md
|
|
- Bedrock Runtime: services/bedrock-runtime.md
|
|
- Bedrock AgentCore: services/bedrock-agentcore.md
|
|
- ELB v2: services/elb.md
|
|
- ELB Classic (v1): services/elb-classic.md
|
|
- Auto Scaling: services/autoscaling.md
|
|
- Application Auto Scaling: services/applicationautoscaling.md
|
|
- Elastic Beanstalk: services/elastic-beanstalk.md
|
|
- CodeBuild: services/codebuild.md
|
|
- AWS Batch: services/batch.md
|
|
- SageMaker: services/sagemaker.md
|
|
- CodeDeploy: services/codedeploy.md
|
|
- CodeGuru Reviewer: services/codegurureviewer.md
|
|
- CodeArtifact: services/codeartifact.md
|
|
- CodePipeline: services/codepipeline.md
|
|
- Service Quotas: services/servicequotas.md
|
|
- AWS RAM: services/ram.md
|
|
- AWS Backup: services/backup.md
|
|
- AWS FIS: services/fis.md
|
|
- CloudTrail: services/cloudtrail.md
|
|
- CloudFront: services/cloudfront.md
|
|
- Route53: services/route53.md
|
|
- Route 53 Resolver: services/route53resolver.md
|
|
- AWS Cloud Map: services/cloudmap.md
|
|
- AWS IoT Core: services/iot.md
|
|
- AppSync: services/appsync.md
|
|
- Transfer Family: services/transfer.md
|
|
- DataSync: services/datasync.md
|
|
- AWS Config: services/config.md
|
|
- EMR: services/emr.md
|
|
- EMR Serverless: services/emr-serverless.md
|
|
- WAF v2: services/wafv2.md
|
|
- AWS Network Firewall: services/network-firewall.md
|
|
- Textract: services/textract.md
|
|
- Transcribe: services/transcribe.md
|
|
- Comprehend: services/comprehend.md
|
|
- Rekognition: services/rekognition.md
|
|
- Translate: services/translate.md
|
|
- Pricing: services/pricing.md
|
|
- Cost Explorer: services/ce.md
|
|
- Cost and Usage Reports: services/cur.md
|
|
- BCM Pricing Calculator: services/bcm-pricing-calculator.md
|
|
- BCM Data Exports: services/bcm-data-exports.md
|
|
- Web Console:
|
|
- Overview: ui/index.md
|
|
- Console Contract v1: ui/console-contract.md
|
|
- Testcontainers:
|
|
- Overview: testcontainers/index.md
|
|
- Java: testcontainers/java.md
|
|
- Node.js / TypeScript: testcontainers/nodejs.md
|
|
- Python: testcontainers/python.md
|
|
- .NET: testcontainers/dotnet.md
|
|
- Go: testcontainers/go.md
|
|
- Contributing: contributing.md
|