Commit Graph

123 Commits

Author SHA1 Message Date
tudor-da
6da1cde1b3
Simplify IndexService hierarchy [DPP-932] (#13043)
* Squash LedgerBackedIndexService, SpannedIndexService and MeteredReadOnlyLedger
into ReadOnlyLedgerImpl

changelog_begin
changelog_end

* Rename ReadOnlyLedgerImpl to IndexServiceImpl

* Metrics cleanup
* Remove redundant metered layer stemming from MeteredReadOnlyLedger

* Simplified getLedgerId

* Addressed Marton's review comments
2022-03-01 14:30:30 +01:00
Sergey Kisel
c50360bbb2
[DPP-601] Measure only active time in indexer stage metrics (#12951)
* [DPP-601] Measure only active time in indexer stage metrics

changelog_begin
changelog_end
2022-02-22 18:07:26 +01:00
Simon Maxen
cc4c06c640
Metering Aggregation [DPP-818] (#12723)
* Add support for aggregated transaction metering

changelog_begin
Support added for aggregated transaction metering
changelog_end

* Update with review comments
2022-02-14 11:36:23 +00:00
mziolekda
42ff83d456
Remove daml on sql artifacts and docs (#12870)
* stop publishing daml on sql aka Daml Driver for PotgreSQL

CHANGELOG_BEGIN
Stop publishing Daml Driver for PostgreSQL
CHANGELOG_END
2022-02-10 18:01:18 +00:00
Marton Nagy
9d4c210900
Remove maximumLedgerTime DB query (pure refactoring) (#12804)
changelog_begin
changelog_end
2022-02-08 12:40:12 +01:00
Marton Nagy
cbff4b124a
LAPI code cleanup (pure refactoring) (#12768)
removing dead code

changelog_begin
changelog_end
2022-02-07 12:43:06 +00:00
Brian Healey
e70237a673
upgrade scalapb/netty/grpc/protobuf in proven combination (#12628)
* upgrade scalapb/netty/grpc/protobuf in proven combination

CHANGELOG_BEGIN
Upgrade scalapb, netty, grpc, protobuf and guava versions
CHANGELOG_END

* bazel reformat

* match grpc version in deps.bzl

* upgrade akka

* keep grpc version to 1.43 that is used in latest nixpkgs-unstable

* rebase and regen

* update SHA for scalapb tarball

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2022-02-03 08:38:38 -05:00
tudor-da
5390505627
Remove participant-side command deduplication [DPP-848] (#12677)
* Remove participant-side command deduplication

changelog_begin
changelog_end

* Addressed review comments
2022-02-01 20:50:25 +00:00
Simon Maxen
6cdda6fbf7
Metering report [DPP-817] (#12604)
With experimental support for non-aggregated metering reporting

changelog_begin
with experimental support for non-aggregated metering reporting
changelog_end
2022-02-01 10:38:04 +00:00
Hubert Slojewski
7aabc492a9
Update OpenTelemetry from 0.16.0 to 1.1.0 [KVL-1256] (#12568)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-31 18:30:29 +01:00
tudor-da
89ce7d0245
Remove conflict-checking logic from JdbcLedgerDao [DPP-808] (#12555)
* Remove conflict-checking logic from JdbcLedgerDao

changelog_begin
changelog_end

* Remove configuration conflict-checking logic and testing

changelog_begin
changelog_end

* Addressed review comments
* Removed one metric
* Removed Rejections transformation used in sandbox-classic and unit tests
2022-01-27 10:14:52 +00:00
pbatko-da
4fe6e53b9d
[User management] Persistence with caching (#12344)
Adding
 - `PersistentUserManagementStore` and `CachedUserManagementStore`,
 - `UserManagementStorageBackendTemplate` and sql migrations,
 - CLI flags: `--user-management-max-cache-size` and `--user-management-cache-expiry`;
 And wiring `PersistentUserManagementStore` where before we had `InMemoryUserManagementStore`.
2022-01-18 15:59:22 +01:00
akshayshirahatti-da
50de6e3639
[JSON-API] HOCON config json api (#12236)
* Change heartBeatPer to more intuitive naming of heartbeatPeriod

CHANGELOG_BEGIN
CHANGELOG_END

* Initial changes to add HOCON config for json_api

CHANGELOG_BEGIN
CHANGELOG_END

* avoid IllegalArgumentException noise

* use named arguments in big config conversion

* Changes include
 - tests for a full http-json-api config file
 - logging config and non-repudiation config is still specified via cli args.
 - config readers for MetricsReporter

* Add defaults to WebsocketConfig case class to allow partially specifying fields on typeconf file

* changes to the JwtVerifierBase config reader and equivalent test

* message already describes the value

* replace manual succeed/fails with scalatest combinators

* use qualified imports for WebsocketConfig defaults

* add back autodeleted empty lines

* collapse two lists of token verifiers into one

* add new line to config files

* rename dbStartupMode to startMode to keep consistent with cli option and for easy documentation

* Changes to daml docs to specify ways to run JSON-API by supplying a HOCON config file.

CHANGELOG_BEGIN
JSON-API can now be started supplying a HOCON application config file using the `--config` option.
All CLI flags except `logging` and `non-repudiation` one's are now deprecated and will be cleaned up in some future releases.
CHANGELOG_END

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-01-10 23:07:07 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Samir Talwar
9f8e640b1a
Use ExecutionContext.parasitic instead of DirectExecutionContext. (#11783)
* concurrent: Replace `DirectExecutionContextInternal` with `parasitic`.

* concurrent: Rename `DirectExecutionContext` `parasitic`.

* Use `ExecutionContext.parasitic` instead of `DirectExecutionContext`.

We no longer need the latter.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix formatting.
2021-12-10 16:25:46 +01:00
nicu-da
61334cff77
kvutils - Add Writer which can handle deduplication periods as offsets [KVL-1172] (#11900)
changelog_begin
changelog_end
2021-11-29 10:28:07 -08:00
Victor Peter Rouven Müller
df373466dc
[JSON-API] Add query store metrics (#11809)
* Add query store metrics

CHANGELOG_BEGIN

- [JSON-API] added metrics to separately track:
    - time taken to update query-store ACS (from ledger)
    - lookup times for the query store

CHANGELOG_END

* Apply review comment
2021-11-25 13:04:28 +00:00
Hubert Slojewski
109b60613c
Make the InstrumentedSource.queue use the BoundedSourceQueue [KVL-1177] (#11807)
CHANGELOG_BEGIN

- [Integration Kit] InstrumentedSource.queue.offer no longer returns a Future

CHANGELOG_END
2021-11-24 11:26:39 +01:00
Moritz Kiefer
fa7663148a
Drop 2.12 versioned_scala_deps (#11748)
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.

changelog_begin
changelog_end
2021-11-17 22:13:08 +00:00
Marton Nagy
eca53e9ede
Integrate ACSReader [DPP-720] (#11688)
* Integrating ACSReader and 2 phase retrieval logic to TransactionReader
* Add metrics and debug logging

changelog_begin
changelog_end
2021-11-17 09:46:24 +00:00
Marton Nagy
f8f88072ee
Activate interning write side [DPP-710] (#11614)
After this PR is merged write side of string-interning is activated:
* String interning table is being populated as part of usual indexing
* Data migration will populate the table from already existent data
Effect of populating string interning is not visible yet.

List of changes
* Add schema and data migrations where applicable
* Patch up sandbox-classic and parallel indexer to populate string_interning persistence, and initialize write side string interning view
* Add ledger_end_stringinterning_id to track the need for update at the view (+ aligning code)
* remove lookupLedgerEndOffsetAndSequentialId
* fix/extend unit-tests

changelog_begin
changelog_end
2021-11-10 16:17:07 +00:00
Miklos
7a54ca1926
Damlification of metrics prefix (#9665)
* Damlification of metrics prefix.
CHANGELOG_BEGIN
CHANGELOG_END

* Fixed reference to metrics prefix.

CHANGELOG_BEGIN
CHANGELOG_END
2021-10-11 19:00:27 +00:00
akshayshirahatti-da
d809fd934a
[JSON-API] surrogate template id cache (#10806)
* Initial changes to add a surrogate_template_id cache to reduce db queries

CHANGELOG_BEGIN
CHANGELOG_END

* refactoring and addition of tests

* Code review based changes to use Contextual Logger and json-api metrics instance

* make max cache entries/size configurable

* Rename cache max entries default variable
2021-09-10 10:48:58 +00:00
tudor-da
e5a6d70182
Added buffer size metrics for getTransactions/getTransactionTrees (#10744)
CHANGELOG_BEGIN
CHANGELOG_END
2021-09-03 10:51:00 +02:00
pbatko-da
bdc511eaa9
[DPP-438] Change open-ended metric names into static ones (by removing partyName part) (#10706)
* [DPP-438] Change open-ended metric names into static ones (by removing partyName part)

CHANGELOG_BEGIN
CHANGELOG_END

* revert changes in Ctx.scala

* 1
2021-08-31 16:42:41 +02:00
tudor-da
dea57ca099
In-memory fan-out optimizations (#10558)
* Time conversion duration between buffer event and API domain transaction
* Compute partiesTemplates inversion mapping outside events transformation
* Other small optimizations

CHANGELOG_BEGIN
CHANGELOG_END
2021-08-23 20:31:23 +02:00
Samir Talwar
4b8b67a1b5
Upgrade Scalatest to v3.2.9. (#10576)
* Upgrade Scalatest to v3.2.9.

Because of some coupling we also have to upgrade Scalaz to the latest
v7.2 point release, v7.2.33.

The Scalatest changes are quite involved because the JAR has been broken
up into several smaller JARs. Because Bazel expects us to specify all
dependencies and doesn't allow transitive dependencies to be used
directly, this means that we need to specify the explicit Scalatest
components that we use.

As you can imagine, this results in quite a big set of changes. They
are, however, constrained to dependency management; all the code remains
the same.

CHANGELOG_BEGIN
CHANGELOG_END

* http-json-oracle: Fix a Scalatest dependency.

* ledger-api-client: Fix a Scalatest dependency.
2021-08-12 23:19:35 +00:00
Samir Talwar
12599e7f06
Disable configuration management until the ledger has a configuration. [KVL-1058] (#10478)
* participant-integration-api: Move test constants to a companion object.

TelemetrySpecBase doesn't need to expose those through inheritance.

* Avoid mocks in the configuration management service test.

* Add tests for `ConfigManagementService.GetTimeModel`.

* Add tests for `ConfigManagementService.SetTimeModel`.

* Disable configuration management until the ledger has a configuration.

CHANGELOG_BEGIN
- [API Server] The configuration management service previously returned
  the participant-specified default configuration if none was found on
  the ledger. This can be misleading, and so the ``GetTimeModel``
  endpoint now returns a gRPC ``NOT_FOUND`` error if no configuration
  has been found yet. Similarly, the ``SetTimeModel`` endpoint returns a
  gRPC ``UNAVAILABLE`` error.

  This should only happen if the participant gives up waiting for the
  ledger to provide a configuration, which is very unlikely in a
  production setting. In this case, the ledger will also not respond to
  command submissions.
CHANGELOG_END

* participant-integration-api: Extract some test variables for clarity.

In ApiConfigManagementServiceSpec.

* sandbox: Improve some variable and parameter names in tests for clarity.

* Improve the error message in case of a missing ledger configuration.

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* ledger-api-common: Improve an error status constructor name.

Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-08-04 20:34:22 +00:00
Samir Talwar
b325e8a8b8
participant-state: Remove WriteService#rejectSubmission. (#10407)
It's not currently used. We will re-introduce it when we plan on
actually implementing it.

CHANGELOG_BEGIN
CHANGELOG_END
2021-07-26 13:03:05 +00:00
Samir Talwar
b9518ce2f4
participant-state-metrics: Add wrappers for v2. (#10404)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-26 11:06:02 +00:00
tudor-da
93d0ed6821
[Mutable cache] Resolve with full lookup on negative cache read-through lookups [DPP-501] (#10262)
* [Mutable cache] Resolve with full lookup on missed cache thread-throughs
* Do not store negative lookups
* Metrics for counting divulgence and full lookups
* Metrics for counting read-through not found

CHANGELOG_BEGIN
CHANGELOG_END

* Added comment detailing secondary lookups for divulgence

* Apply suggestions from code review

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>
2021-07-20 16:15:04 +02:00
Marton Nagy
5fa49c3312
Disables flaky test suite of InstrumentedSource.bufferedSource (#10321)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-20 06:48:49 +00:00
Victor Peter Rouven Müller
80b65f6def
[DOCS] Add documentation for the JSON API metrics (#10312)
* [DOCS] Add documentation for the JSON API metrics

changelog_begin

- [JSON-API] You can now find a section `Metrics` in the http-json api documentation explaining how to enable metrics and which are available

changelog_end

* Fix rst build warnings

* Update docs/source/json-api/metrics.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Adapt metrics doc to state that it IS an exhaustive list and remove wrong copy pasta text & add info about prometheus

* Update the legal values for the metrics reporter cli option

* shorten the description, the change prior was unnecessary ._.

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-07-19 17:32:23 +02:00
tudor-da
3fd3abfb26
Instrument buffer after contract state events stream (#10209)
CHANGELOG_BEGIN
CHANGELOG_END
2021-07-12 19:37:32 +02:00
tudor-da
d5d6cfacff
[Mutable state cache] contractStateEvents bounded DB fetch size [DPP-464] (#10092)
* [Mutable state cache] TransactionsReader.getContractStateEvents bounded fetch page size

CHANGELOG_BEGIN
CHANGELOG_END

* Improved TransactionsReader.splitRange
* Removed explicit minChunkSize
* Added property check test

* Metrics for getContractStateEvents and getTransactionLogUpdates chunk fetch size

* Addressed review comments

* Adress Kamil's review comment

* Miklos' suggestion

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-06-30 09:25:07 +00:00
mziolekda
621cfa4a91
Resolve contract keys conflicts in disclosed contracts (#9948) (#10034)
* Resolve contract keys conflicts in disclosed contracts (#9948)

* build queries for nullifications of past key

* format code

CHANGELOG_BEGIN
In case a contract key is already present in a past contract in the contract table nullify it. This gets rid of contract keys of previously disclosed contracts. We never discover that disclosed contracts get archived, so we get conflicts on such past keys
CHANGELOG_END

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* correct oracle implemantation (new)

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-28 17:04:18 +02:00
Marton Nagy
05056ddd8c
Cut a flaky expectation some more slack (#10106)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 11:35:41 +00:00
Victor Peter Rouven Müller
1f5aa4491c
[JSON-API] Add metrics for ledger command submission timing (#10076)
changelog_begin

- [JSON-API] Timing metrics which measure how long the processing of a command submission request takes on the ledger are now available

changelog_end
2021-06-22 15:59:23 +00:00
Victor Peter Rouven Müller
0391f3529f
[JSON-API] Add db metrics & response construction metrics (#10068)
changelog_begin

- [JSON-API] The database operations (regardless of in-memory or postgres) contain now metrics for fetching contracts by id or key (seperate metrics foreach)
- [JSON-API] The time for a repsonse payload construction of a request is now also tracked in a metric

changelog_end
2021-06-22 10:34:29 +02:00
Victor Peter Rouven Müller
e4585295c6
[JSON-API] Add moar timing metrics (#10045)
* [JSON-API] Add more timing metrics

changelog_begin

- [JSON-API] Timing metrics are now available for party management, package management, command submission and query endpoints.
- [JSON-API] Also added a timing metric for parsing and decoding of incoming json payloads

changelog_end

* Add comments to new metrics

* Split metrics up more & remove obsolete metric

* Split up timers for query endpoints
2021-06-21 14:37:36 +00:00
Victor Peter Rouven Müller
1852830833
[JSON-API] Concurrent query etc. metrics (#10031)
* [JSON-API] Concurrent query etc. metrics

changelog_begin

- [JSON-API] The metrics which describe the amount of these concurrent events is now available:
	- running http request
	- command submissions
	- package allocations
	- party allocations

changelog_end

* Rename running metrics to throughput ones & add comments on the metrics

* Adjust names of other existing metrics too, to have for the json api a more consistent metrics naming
2021-06-16 17:08:06 +00:00
Brian Healey
993591e53b
truncate party name for 64 chars for multi-valued submitters to avoid… (#10000)
* truncate party name for 64 chars for multi-valued submitters to avoid excessively long metrics name

CHANGELOG_BEGIN
[metrics] Limit size of multi party metrics to ease consumption
CHANGELOG_END

* Use just first party for dynamic metrics when there are multiple parties involved
2021-06-16 08:52:27 -04:00
tudor-da
e49c7c8db7
[In-memory fan-out] BufferedTransactionsReader implementation [DPP-413] [DPP-414] (#9882)
* [In-memory fan-out] BufferedTransactionsReader implementation
* getTransactions
* getTransactionTrees

CHANGELOG_BEGIN
CHANGELOG_END

* Address review comments
2021-06-15 16:29:53 +02:00
Victor Peter Rouven Müller
4037b1cd9e
Add metrics to the http json service (#9923)
* Introduce metrics in the http-json service

changelog_begin

[HTTP/JSON API]
- metrics reporting can now be chosen via the command line option --metrics-reporter (currently hidden), valid options are console, csv://, graphite:// and prometheus://
- metrics reporting interval can also now be chosen via a command line option --metrics-reporting-interval (currently hidden)

changelog_end

* Move MetricsReporter and it's dependencies into //ledger/metrics

* Restore non-ugly formatting for that one section in Endpoints.scala

* Update ledger/sandbox-common/src/test/lib/scala/platform/sandbox/cli/CommonCliSpecBase.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Hide metrics option for http-json

* Propagate context exception for the parseUri function in MetricsReporter.scala

* Move cliHint value above parseUri function to have a better structure (it's used once before it's defined and once after it's defined, which is weird to me)

* Use better value name than optMr & optFd in cliopts Metrics.scala

* Remove import order changes & whitespace changes

* Revert usage of Nanoseconds for conversion from scala duration to java duration to usage of Seconds

* Shorten hideIfRequested function

* Fix another rearranged import

* Fix another whitespace removal

* Readd metrics cli option to sandbox after refactoring

* Add missing return type annotation for invalidRead in MetricsReporter

* Readd newline in https OptionParser.scala

* Remove unecessary import

* Update ledger/sandbox-common/src/main/scala/platform/sandbox/cli/CommonCliBase.scala

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>

* Align setter & config name for metricsReportingInterval setting too in CommonCliBase.scala

* Rename http_json_api in Metrics.scala of metrics project to HttpJsonApi

* Reformat CommonCliBase.scala of sandbox-common project

* Fix CommonCliSpecBase test of sandbox

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2021-06-08 15:54:01 +00:00
tudor-da
69ef6243cb
Fix flaky InstrumentedSourceSpec test (#9921)
* Lower expectations in `signal mostly full buffer if slow consumer`

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-08 12:27:03 +00:00
mziolekda
f36f556b73
Metrics for streamed elements (#9873)
* CHANGELOG_BEGIN
Add metrics counting the elements in transaction, transaction-tree, completion and acs streams
CHANGELOG_END

* format scala

* address review comments
2021-06-02 11:39:09 +00:00
tudor-da
6e17e2de75
[In memory fan-out] Transaction log updates stream implementation (#9792)
* [In memory fan-out] Transaction log updates stream implementation

CHANGELOG_BEGIN
CHANGELOG_END

* Addressed review comments
2021-05-28 12:23:33 +00:00
tudor-da
63bc0d1a96
EventsBuffer implementation for in-memory fan-out for Ledger API serving (#9775)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-28 08:23:34 +02:00
Marton Nagy
e50885caa8
Dpp 388 todo cleanup parallel indexer (#9690)
* Removes TODO related to BatchingParallelIngestionPipe type: the result of the ingestion is not needed at the moment
* Removes TODO related to groupedWithin: at this point the introduced latency seems not significant
* Refactor AsyncSupport
* Removing some TODOs related to postponed work-items
* moving mutable initialisation code does not make sense without refactoring/segregating the initialisation part of the LedgerDao. That effort is postponed as per group decision.
* Injecting the dispatcher makes little sense at this point, further features might require it.
* Fixes type derivation in ParallelIndexerFactory
* Moves instrumentedBufferedSource to metrics (+ unit tests)
* Removes TODO related to logging: primarily to pass down the initializing LoggingContext is fine. (further logging discussion is in progress related to ingestion at the time of writing)
* Refactor type cast towards synthetic zero-element generation
* Expose configuration for the instrumented input, lowers default.
* Remove TODO related wiring of indexer HealthChecks: there is already an issue for this: https://github.com/digital-asset/daml/issues/2733
* Remove TODO related to lowering connectionTimeout for Hikari database-connection pool: it is already the minimum, no smaller connection timeout is available for selection.

changelog_begin
changelog_end
2021-05-18 02:34:02 +02:00
Hubert Slojewski
927242be40
KVL-914 Add and rework unit tests for tracing (#9686)
* Add and rework unit tests for tracing
CHANGELOG_BEGIN
CHANGELOG_END

* Add assertion

* Minor cleanup

* Add missing header

* Remove an empty line
2021-05-14 16:36:29 +02:00